Syntax Highlighting
HighlightJS
HTML
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Title</title>
</head>
<body>
<!-- Your content -->
</body>
</html>
CSS
/*
=================================================================
SECTION
=================================================================
*/
/* Sub section 1 */
selector {
}
/* Sub section 2 */
selector {
}
/*
=================================================================
SECTION
=================================================================
*/
/* Sub section 1 */
selector {
}
/* Sub section 2 */
selector {
}
SCSS
$font-stack: Helvetica, sans-serif;
$primary-color: #333;
body {
font: 100% $font-stack;
color: $primary-color;
}
Less
@base: #f938ab;
.box-shadow(@style, @c) when (iscolor(@c)) {
-webkit-box-shadow: @style @c;
box-shadow: @style @c;
}
.box-shadow(@style, @alpha: 50%) when (isnumber(@alpha)) {
.box-shadow(@style, rgba(0, 0, 0, @alpha));
}
.box {
color: saturate(@base, 5%);
border-color: lighten(@base, 30%);
div { .box-shadow(0 0 5px, 30%) }
}
JavaScript
/*
* Document : app.js
* Author : pixelcave
*/
var App = function() {
// User Interface init
var uiInit = function() {
};
return {
init: function() {
uiInit();
}
};
}();
// Initialize app when page loads
jQuery(function(){ App.init(); });
PHP
<?php
class App {
function home() {
// ...
}
function profile() {
// ...
}
function settings() {
// ...
}
}
Ruby
# Output "I love Ruby"
say = "I love Ruby"
puts say
# Output "I *LOVE* RUBY"
say['love'] = "*love*"
puts say.upcase
# Output "I *love* Ruby"
# five times
5.times { puts say }
Python
name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
JSON
{
"menu": {
"id": "file",
"value": "File",
"popup": {
"menuitem": [
{"value": "New", "onclick": "CreateNewDoc()"},
{"value": "Open", "onclick": "OpenDoc()"},
{"value": "Close", "onclick": "CloseDoc()"}
]
}
}
}