Syncing

Last updated: March 15th, 2020

Syncing

PrismJS is used as the syntax highlighter here. You can build your own version via their website should you need to.

Useful Tip:

You can use this online HTML entity encoder/decoder to generate your code examples.

HTML Code Example
<!DOCTYPE html>
<html lang="en">
    ...
    <div class="jumbotron">
        <h1>Hello, world!</h1>
        <p>...</p>
        <p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a></p>
    </div>
    <div class="jumbotron">
        <h1>Hello, world!</h1>
        <p>...</p>
        <p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a></p>
    </div>
    ...
</html>
CSS Code Example
/* ======= Base Styling ======= */
body {
    font-family: 'Open Sans', arial, sans-serif;
    color: #333;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
SCSS Code Example
@mixin transform($property) {
  -webkit-transform: $property;
      -ms-transform: $property;
          transform: $property;
}

.box { @include transform(rotate(30deg)); }
LESS Code Example
@base: #f04615;
@width: 0.5;

.class {
  width: percentage(@width); // returns `50%`
  color: saturate(@base, 5%);
  background-color: spin(lighten(@base, 25%), 8);
}
JavaScript Code Example
<script>
    function myFunction(a, b) {
        return a * b;
    }

    document.getElementById("demo").innerHTML = myFunction(4, 3);
</script>
Python Code Example
>>> x = int(input("
Please enter an integer: ")) Please enter an integer: 42
>>> if x < 0:
... x = 0
... print('Negative changed to zero')
... elif x == 0:
... print('Zero')
... elif x == 1:
... print('Single')
... else:
... print('More')
... More
PHP Code Example
<?php
$txt = "Hello world!";
$x = 5;
$y = 10.5;

echo $txt;
echo "<br>";
echo $x;
echo "<br>";
echo $y;
?>