UNPKG

syntax-highlighting

Version:

Syntax Highlighting Colorschemes for many applications

2,041 lines (1,693 loc) 108 kB
<!DOCTYPE html> <head> <title>highlight.js demo</title> <meta charset="utf-8"> <style>@font-face{font-family:'FiraSans-Regular';src:url(../../assets/fonts/FiraSans-Regular.woff) format('woff'),url(../../assets/fonts/FiraSans-Regular.woff2) format('woff2');font-weight:normal;font-style:normal;}@font-face{font-family:'FiraSans-Medium';src:url(../../assets/fonts/FiraSans-Medium.woff) format('woff'),url(../../assets/fonts/FiraSans-Medium.woff2) format('woff2');font-weight:normal;font-style:normal;}</style> <link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/perfect-scrollbar.min.css"> <link rel="stylesheet" title="Default" href="../output/highlight.js/base16-ateliersulphurpool.light.css"> <link rel="alternate stylesheet" title="Cave dark" href="../output/highlight.js/base16-ateliercave.dark.css"> <link rel="alternate stylesheet" title="Cave light" href="../output/highlight.js/base16-ateliercave.light.css"> <link rel="alternate stylesheet" title="Dune dark" href="../output/highlight.js/base16-atelierdune.dark.css"> <link rel="alternate stylesheet" title="Dune light" href="../output/highlight.js/base16-atelierdune.light.css"> <link rel="alternate stylesheet" title="Estuary dark" href="../output/highlight.js/base16-atelierestuary.dark.css"> <link rel="alternate stylesheet" title="Estuary light" href="../output/highlight.js/base16-atelierestuary.light.css"> <link rel="alternate stylesheet" title="Forest dark" href="../output/highlight.js/base16-atelierforest.dark.css"> <link rel="alternate stylesheet" title="Forest light" href="../output/highlight.js/base16-atelierforest.light.css"> <link rel="alternate stylesheet" title="Heath dark" href="../output/highlight.js/base16-atelierheath.dark.css"> <link rel="alternate stylesheet" title="Heath light" href="../output/highlight.js/base16-atelierheath.light.css"> <link rel="alternate stylesheet" title="Lakeside dark" href="../output/highlight.js/base16-atelierlakeside.dark.css"> <link rel="alternate stylesheet" title="Lakeside light" href="../output/highlight.js/base16-atelierlakeside.light.css"> <link rel="alternate stylesheet" title="Plateau dark" href="../output/highlight.js/base16-atelierplateau.dark.css"> <link rel="alternate stylesheet" title="Plateau light" href="../output/highlight.js/base16-atelierplateau.light.css"> <link rel="alternate stylesheet" title="Savanna dark" href="../output/highlight.js/base16-ateliersavanna.dark.css"> <link rel="alternate stylesheet" title="Savanna light" href="../output/highlight.js/base16-ateliersavanna.light.css"> <link rel="alternate stylesheet" title="Seaside dark" href="../output/highlight.js/base16-atelierseaside.dark.css"> <link rel="alternate stylesheet" title="Seaside light" href="../output/highlight.js/base16-atelierseaside.light.css"> <link rel="alternate stylesheet" title="Sulphurpool dark" href="../output/highlight.js/base16-ateliersulphurpool.dark.css"> <link rel="alternate stylesheet" title="Sulphurpool light" href="../output/highlight.js/base16-ateliersulphurpool.light.css"> <script src="js/highlight.pack.js"></script> <script src="js/jquery-2.1.1.min.js"></script> <script src="js/perfect-scrollbar.min.js"></script> <script src="js/demo.js"></script> <body> <div id="sidebar"> <div id="header"> <h1><a href="https://highlightjs.org/">Highlight.js</a> demo</h1> </div> <div id="lists"> <div> <h2>Language categories</h2> <ul id="categories"></ul> </div> <div> <h2>Atelier Schemes <small>Styles</small></h2> <ul id="styles"></ul> </div> </div> </div> <div id="content"> <div id="languages"> <div class="enterprise"> <h2>1C</h2> <pre><code class="1c">#Если Клиент Тогда Перем СимвольныйКодКаталога = &quot;ля-ля-ля&quot;; //комментарий Функция Сообщить(Знач ТекстСообщения, ТекстСообщения2) Экспорт //комментарий к функции x=ТекстСообщения+ТекстСообщения2+&quot; |строка1 |строка2 |строка3&quot;; КонецФункции #КонецЕсли // Процедура ПриНачалеРаботыСистемы // Процедура ПриНачалеРаботыСистемы() Обработки.Помощник.ПолучитьФорму(&quot;Форма&quot;).Открыть(); d = &#39;21.01.2008&#39; КонецПроцедуры </code></pre> </div> <div class="scripting"> <h2>ActionScript</h2> <pre><code class="actionscript">package org.example.dummy { import org.dummy.*; /*define package inline interface*/ public interface IFooBarzable { public function foo(... pairs):Array; } public class FooBar implements IFooBarzable { static private var cnt:uint = 0; private var bar:String; //constructor public function TestBar(bar:String):void { bar = bar; ++cnt; } public function foo(... pairs):Array { pairs.push(bar); return pairs; } } }</code></pre> </div> <div class="common config"> <h2>Apache</h2> <pre><code class="apache"># rewrite&#96;s rules for wordpress pretty url LoadModule rewrite_module modules/mod_rewrite.so RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php [NC,L] ExpiresActive On ExpiresByType application/x-javascript &quot;access plus 1 days&quot; Order Deny,Allow Allow from All &lt;Location /maps/&gt; RewriteMap map txt:map.txt RewriteMap lower int:tolower RewriteCond %{REQUEST_URI} ^/([^/.]+)\.html$ [NC] RewriteCond ${map:${lower:%1}|NOT_FOUND} !NOT_FOUND RewriteRule .? /index.php?q=${map:${lower:%1}} [NC,L] &lt;/Location&gt; </code></pre> </div> <div class="scripting"> <h2>AppleScript</h2> <pre><code class="applescript">repeat 5 times if foo is greater than bar then display dialog &quot;Hello there&quot; else beep end if end repeat (* comment (*nested comment*) *) on do_something(s, y) return {s + pi, y mod 4} end do_something do shell script &quot;/bin/echo &#39;hello&#39;&quot; </code></pre> </div> <div class=""> <h2>AsciiDoc</h2> <pre><code class="asciidoc">Hello, World! ============ Author Name, &lt;author@domain.foo&gt; you can write text http://example.com[with links], optionally using an explicit link:http://example.com[link prefix]. * single quotes around a phrase place &#39;emphasis&#39; ** alternatively, you can put underlines around a phrase to add _emphasis_ * astericks around a phrase make the text *bold* * pluses around a phrase make it +monospaced+ * &#96;smart&#39; quotes using a leading backtick and trailing single quote ** use two of each for double &#96;&#96;smart&#39;&#39; quotes - escape characters are supported - you can escape a quote inside emphasized text like &#39;here\&#39;s johnny!&#39; term:: definition another term:: another definition // this is just a comment Let&#39;s make a break. &#39;&#39;&#39; //// we&#39;ll be right with you after this brief interruption. //// == We&#39;re back! Want to see a image::images/tiger.png[Tiger]? .Nested highlighting ++++ &lt;this_is inline=&quot;xml&quot;&gt;&lt;/this_is&gt; ++++ ____ asciidoc is so powerful. ____ another quote: [quote, Sir Arthur Conan Doyle, The Adventures of Sherlock Holmes] ____ When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth. ____ Getting Literal --------------- want to get literal? prefix a line with a space. .... I&#39;ll join that party, too. .... . one thing (yeah!) . two thing &#96;i can write code&#96;, and &#96;more&#96; wipee! NOTE: AsciiDoc is quite cool, you should try it.</code></pre> </div> <div class=""> <h2>AspectJ</h2> <pre><code class="aspectj">package com.aspectj.syntax; import org.aspectj.lang.annotation.AdviceName; privileged public aspect LoggingAspect percflowbelow(ajia.services.*){ private pointcut getResult() : call(* *(..) throws SQLException) &amp;&amp; args(Account, .., int); @AdviceName(&quot;CheckValidEmail&quot;) before (Customer hu) : getResult(hu){ System.out.println(&quot;Your mail address is valid!&quot;); } Object around() throws InsufficientBalanceException: getResult() &amp;&amp; call(Customer.new(String,String,int,int,int)){ return proceed(); } public Cache getCache() { return this.cache; } pointcut beanPropertyChange(BeanSupport bean, Object newValue): execution(void BeanSupport+.set*(*)) &amp;&amp; args(newValue) &amp;&amp; this(bean); declare parents: banking.entities.* implements BeanSupport; declare warning : call(void TestSoftening.perform()): &quot;Please ensure you are not calling this from an AWT thread&quot;; private String Identifiable.id; public void Identifiable.setId(String id) { this.id = id; } }</code></pre> </div> <div class="scripting"> <h2>AutoHotkey</h2> <pre><code class="autohotkey">; hotkeys and hotstrings #a::WinSet, AlwaysOnTop, Toggle, A #Space:: MsgBox, Percent sign (&#96;%) need to be escaped. Run &quot;C:\Program Files\some\program.exe&quot; Gosub, label1 return ::btw::by the way ; volume #Numpad8::Send {Volume_Up} #Numpad5::Send {Volume_Mute} #Numpad2::Send {Volume_Down} label1: if (Clipboard = &quot;&quot;) { MsgBox, , Clipboard, Empty! } else { StringReplace, temp, Clipboard, old, new, All MsgBox, , Clipboard, %temp% } return </code></pre> </div> <div class=""> <h2>AVR Assembler</h2> <pre><code class="avrasm">;* Title: Block Copy Routines ;* Version: 1.1 .include &quot;8515def.inc&quot; rjmp RESET ;reset handle .def flashsize=r16 ;size of block to be copied flash2ram: lpm ;get constant st Y+,r0 ;store in SRAM and increment Y-pointer adiw ZL,1 ;increment Z-pointer dec flashsize brne flash2ram ;if not end of table, loop more ret .def ramtemp =r1 ;temporary storage register .def ramsize =r16 ;size of block to be copied </code></pre> </div> <div class="enterprise"> <h2>Axapta</h2> <pre><code class="axapta">class ExchRateLoadBatch extends RunBaseBatch { ExchRateLoad rbc; container currencies; boolean actual; boolean overwrite; date beg; date end; #define.CurrentVersion(5) #localmacro.CurrentList currencies, actual, beg, end #endmacro } public boolean unpack(container packedClass) { container base; boolean ret; Integer version = runbase::getVersion(packedClass); switch (version) { case #CurrentVersion: [version, #CurrentList] = packedClass; return true; default: return false; } return ret; } </code></pre> </div> <div class="common"> <h2>Bash</h2> <pre><code class="bash">#!/bin/bash ###### BEGIN CONFIG ACCEPTED_HOSTS=&quot;/root/.hag_accepted.conf&quot; BE_VERBOSE=false ###### END CONFIG if [ &quot;$UID&quot; -ne 0 ] then echo &quot;Superuser rights is required&quot; echo &#39;Printing the # sign&#39; exit 2 fi if test $# -eq 0 then elif test [ $1 == &#39;start&#39; ] else fi genApacheConf(){ if [[ &quot;$2&quot; = &quot;www&quot; ]] then full_domain=$1 else full_domain=$2.$1 fi host_root=&quot;${APACHE_HOME_DIR}$1/$2/$(title)&quot; echo -e &quot;# Host $1/$2 :&quot; } </code></pre> </div> <div class=""> <h2>Brainfuck</h2> <pre><code class="brainfuck">++++++++++ [ 3*10 and 10*10 -&gt;+++&gt;++++++++++&lt;&lt; ]&gt;&gt; [ filling cells -&gt;++&gt;&gt;++&gt;++&gt;+&gt;++&gt;&gt;++&gt;++&gt;++&gt;++&gt;++&gt;++&gt;++&gt;++&gt;++&gt;++&gt;++[&lt;/]&lt;[&lt;]&lt;[&lt;]&gt;&gt; ]&lt; +++++++++&lt;&lt; [ rough codes correction loop -&gt;&gt;&gt;+&gt;+&gt;+&gt;+++&gt;+&gt;+&gt;+&gt;+&gt;+&gt;+&gt;+&gt;+&gt;+&gt;+&gt;+&gt;+&gt;+&gt;+[&lt;]&lt; ] more accurate сodes correction &gt;&gt;&gt;++&gt; --&gt;+++++++&gt;------&gt;++++++&gt;++&gt;+++++++++&gt;++++++++++&gt;++++++++&gt;---&gt;++++++++++&gt;------&gt;++++++&gt; ++&gt;+++++++++++&gt;++++++++++++&gt;------&gt;+++ rewind and output [&lt;]&gt;[.&gt;] </code></pre> </div> <div class="protocols"> <h2>Cap’n Proto</h2> <pre><code class="capnproto">@0xdbb9ad1f14bf0b36; # unique file ID, generated by &#96;capnp id&#96; struct Person { name @0 :Text; birthdate @3 :Date; email @1 :Text; phones @2 :List(PhoneNumber); struct PhoneNumber { number @0 :Text; type @1 :Type; enum Type { mobile @0; home @1; work @2; } } } struct Date { year @0 :Int16; month @1 :UInt8; day @2 :UInt8; flags @3 :List(Bool) = [ true, false, false, true ]; } interface Node { isDirectory @0 () -&gt; (result :Bool); } interface Directory extends(Node) { list @0 () -&gt; (list: List(Entry)); struct Entry { name @0 :Text; node @1 :Node; } create @1 (name :Text) -&gt; (file :File); mkdir @2 (name :Text) -&gt; (directory :Directory) open @3 (name :Text) -&gt; (node :Node); delete @4 (name :Text); link @5 (name :Text, node :Node); } interface File extends(Node) { size @0 () -&gt; (size: UInt64); read @1 (startAt :UInt64 = 0, amount :UInt64 = 0xffffffffffffffff) -&gt; (data: Data); # Default params = read entire file. write @2 (startAt :UInt64, data :Data); truncate @3 (size :UInt64); }</code></pre> </div> <div class="lisp"> <h2>Clojure REPL</h2> <pre><code class="clojure-repl">user=&gt; (defn f [x y] #_=&gt; (+ x y)) #&#39;user/f user=&gt; (f 5 7) 12 user=&gt; nil nil </code></pre> </div> <div class="lisp"> <h2>Clojure</h2> <pre><code class="clojure">; Comment (def ^{:macro true :added &quot;1.0&quot;} let (fn* let [&amp;form &amp;env &amp; decl] (cons &#39;let* decl))) (def ^:dynamic chunk-size 17) (defn next-chunk [rdr] (let [buf (char-array chunk-size) s (.read rdr buf)] (when (pos? s) (java.nio.CharBuffer/wrap buf 0 s)))) (defn chunk-seq [rdr] (when-let [chunk (next-chunk rdr)] (cons chunk (lazy-seq (chunk-seq rdr))))) </code></pre> </div> <div class=""> <h2>CMake</h2> <pre><code class="cmake">cmake_minimum_required(VERSION 2.8.8) project(cmake_example) # Show message on Linux platform if (${CMAKE_SYSTEM_NAME} MATCHES Linux) message(&quot;Good choice, bro!&quot;) endif() # Tell CMake to run moc when necessary: set(CMAKE_AUTOMOC ON) # As moc files are generated in the binary dir, # tell CMake to always look for includes there: set(CMAKE_INCLUDE_CURRENT_DIR ON) # Widgets finds its own dependencies. find_package(Qt5Widgets REQUIRED) add_executable(myproject main.cpp mainwindow.cpp) qt5_use_modules(myproject Widgets) </code></pre> </div> <div class="common scripting"> <h2>CoffeeScript</h2> <pre><code class="coffeescript">grade = (student, period=(if b? then 7 else 6), messages={&quot;A&quot;: &quot;Excellent&quot;}) -&gt; if student.excellentWork &quot;A+&quot; else if student.okayStuff if student.triedHard then &quot;B&quot; else &quot;B-&quot; else &quot;C&quot; square = (x) -&gt; x * x two = -&gt; 2 math = root: Math.sqrt square: square cube: (x) -&gt; x * square x race = (winner, runners...) -&gt; print winner, runners class Animal extends Being constructor: (@name) -&gt; move: (meters) -&gt; alert @name + &quot; moved #{meters}m.&quot; hi = &#96;function() { return [document.title, &quot;Hello JavaScript&quot;].join(&quot;: &quot;); }&#96; heredoc = &quot;&quot;&quot; CoffeeScript subst test #{ 010 + 0xf / 0b10 + &quot;nested string #{ /\n/ }&quot;} &quot;&quot;&quot; ### CoffeeScript Compiler v1.2.0 Released under the MIT License ### OPERATOR = /// ^ ( ?: [-=]&gt; # function ) /// </code></pre> </div> <div class="common system"> <h2>C++</h2> <pre><code class="cpp">#include &lt;iostream&gt; #define IABS(x) ((x) &lt; 0 ? -(x) : (x)) int main(int argc, char *argv[]) { /* An annoying &quot;Hello World&quot; example */ for (auto i = 0; i &lt; 0xFFFF; i++) cout &lt;&lt; &quot;Hello, World!&quot; &lt;&lt; endl; char c = &#39;\n&#39;; unordered_map &lt;string, vector&lt;string&gt; &gt; m; m[&quot;key&quot;] = &quot;\\\\&quot;; // this is an error return -2e3 + 12l; } </code></pre> </div> <div class="common"> <h2>C#</h2> <pre><code class="cs">using System; #pragma warning disable 414, 3021 public class Program { /// &lt;summary&gt;The entry point to the program.&lt;/summary&gt; public static int Main(string[] args) { Console.WriteLine(&quot;Hello, World!&quot;); string s = @&quot;This &quot;&quot;string&quot;&quot; spans multiple lines!&quot;; dynamic x = new ExpandoObject(); x.MyProperty = 2; return 0; } } async Task&lt;int&gt; AccessTheWebAsync() { // ... string urlContents = await getStringTask; return urlContents.Length; } internal static void ExceptionFilters() { try { throw new Exception(); } catch (Exception e) when (e.Message == &quot;My error&quot;) { } }</code></pre> </div> <div class="common css"> <h2>CSS</h2> <pre><code class="css">@media screen and (-webkit-min-device-pixel-ratio: 0) { body:first-of-type pre::after { content: &#39;highlight: &#39; attr(class); } body { background: linear-gradient(45deg, blue, red); } } @import url(&#39;print.css&#39;); @page:right { margin: 1cm 2cm 1.3cm 4cm; } @font-face { font-family: Chunkfive; src: url(&#39;Chunkfive.otf&#39;); } div.text, #content, li[lang=ru] { font: Tahoma, Chunkfive, sans-serif; background: url(&#39;hatch.png&#39;) /* wtf? */; color: #F0F0F0 !important; width: 100%; } </code></pre> </div> <div class=""> <h2>D</h2> <pre><code class="d">#!/usr/bin/rdmd // Computes average line length for standard input. import std.stdio; /+ this is a /+ nesting +/ comment +/ enum COMPILED_ON = __TIMESTAMP__; // special token enum character = &#39;©&#39;; enum copy_valid = &#39;&amp;copy;&#39;; enum backslash_escaped = &#39;\\&#39;; // string literals enum str = &#96;hello &quot;world&quot;!&#96;; enum multiline = r&quot;lorem ipsum dolor&quot;; // wysiwyg string, no escapes here allowed enum multiline2 = &quot;sit amet \&quot;adipiscing\&quot; elit.&quot;; enum hex = x&quot;66 6f 6f&quot;; // same as &quot;foo&quot; #line 5 // float literals enum f = [3.14f, .1, 1., 1e100, 0xc0de.01p+100]; static if (something == true) { import std.algorithm; } void main() pure nothrow @safe { ulong lines = 0; double sumLength = 0; foreach (line; stdin.byLine()) { ++lines; sumLength += line.length; } writeln(&quot;Average line length: &quot;, lines ? sumLength / lines : 0); } </code></pre> </div> <div class="scripting"> <h2>Dart</h2> <pre><code class="dart">library app; import &#39;dart:html&#39;; part &#39;app2.dart&#39;; /** * Class description and [link](http://dartlang.org/). */ @Awesome(&#39;it works!&#39;) class SomeClass&lt;S extends Iterable&gt; extends BaseClass&lt;S&gt; implements Comparable { factory SomeClass(num param); SomeClass._internal(int q) : super() { assert(q != 1); double z = 0.0; } /// **Sum** function int sum(int a, int b) =&gt; a + b; ElementList els() =&gt; querySelectorAll(&#39;.dart&#39;); } String str = &#39; (${&#39;parameter&#39; + &#39;zxc&#39;})&#39;; String str = &quot; (${true ? 2 + 2 / 2 : null})&quot;; String str = r&#39;\nraw\&#39;; String str = r&quot;\nraw\&quot;; var str = &#39;&#39;&#39; Something ${2+3} &#39;&#39;&#39;; var str = r&quot;&quot;&quot; Something ${2+3} &quot;&quot;&quot;; </code></pre> </div> <div class=""> <h2>Delphi</h2> <pre><code class="delphi">TList = Class(TObject) Private Some: String; Public Procedure Inside; // Suxx End;{TList} Procedure CopyFile(InFileName, var OutFileName: String); Const BufSize = 4096; (* Huh? *) Var InFile, OutFile: TStream; Buffer: Array[1..BufSize] Of Byte; ReadBufSize: Integer; Begin InFile := Nil; OutFile := Nil; Try InFile := TFileStream.Create(InFileName, fmOpenRead); OutFile := TFileStream.Create(OutFileName, fmCreate); Repeat ReadBufSize := InFile.Read(Buffer, BufSize); OutFile.Write(Buffer, ReadBufSize); Until ReadBufSize&lt;&gt;BufSize; Log(&#39;File &#39;&#39;&#39; + InFileName + &#39;&#39;&#39; copied&#39;#13#10); Finally InFile.Free; OutFile.Free; End;{Try} End;{CopyFile} </code></pre> </div> <div class="common"> <h2>Diff</h2> <pre><code class="diff">Index: languages/ini.js =================================================================== --- languages/ini.js (revision 199) +++ languages/ini.js (revision 200) @@ -1,8 +1,7 @@ hljs.LANGUAGES.ini = { case_insensitive: true, - defaultMode: - { + defaultMode: { contains: [&#39;comment&#39;, &#39;title&#39;, &#39;setting&#39;], illegal: &#39;[^\\s]&#39; }, *** /path/to/original timestamp --- /path/to/new timestamp *************** *** 1,3 **** --- 1,9 ---- + This is an important + notice! It should + therefore be located at + the beginning of this + document! ! compress the size of the ! changes. It is important to spell </code></pre> </div> <div class="template"> <h2>Django</h2> <pre><code class="django">{% if articles|length %} {% for article in articles %} {# Striped table #} &lt;tr class=&quot;{% cycle odd,even %}&quot;&gt; &lt;td&gt;{{ article|default:&quot;Hi... &quot;|escape }}&lt;/td&gt; &lt;td {% if article.today %}class=&quot;today&quot;{% endif %}&gt;{{ article.date|date:&#39;d.m.Y&#39; }}&lt;/td&gt; &lt;/tr&gt; {% endfor %} {% endif %} {% comment %} Comments may be long and multiline. Markup is &lt;em&gt;not&lt;/em&gt; highlighted within comments. {% endcomment %} </code></pre> </div> <div class="config"> <h2>Dockerfile</h2> <pre><code class="dockerfile"># Example instructions from https://docs.docker.com/reference/builder/ FROM ubuntu:14.04 MAINTAINER example@example.com ENV foo /bar WORKDIR ${foo} # WORKDIR /bar ADD . $foo # ADD . /bar COPY \$foo /quux # COPY $foo /quux RUN apt-get update &amp;&amp; apt-get install -y software-properties-common\ zsh curl wget git htop\ unzip vim telnet RUN [&quot;/bin/bash&quot;, &quot;-c&quot;, &quot;echo hello ${USER}&quot;] CMD [&quot;executable&quot;,&quot;param1&quot;,&quot;param2&quot;] CMD command param1 param2 EXPOSE 1337 ENV myName=&quot;John Doe&quot; myDog=Rex\ The\ Dog \ myCat=fluffy ENV myName John Doe ENV myDog Rex The Dog ENV myCat fluffy ADD hom* /mydir/ # adds all files starting with &quot;hom&quot; ADD hom?.txt /mydir/ # ? is replaced with any single character COPY hom* /mydir/ # adds all files starting with &quot;hom&quot; COPY hom?.txt /mydir/ # ? is replaced with any single character ENTRYPOINT [&quot;executable&quot;, &quot;param1&quot;, &quot;param2&quot;] ENTRYPOINT command param1 param2 VOLUME [&quot;/data&quot;] USER daemon WORKDIR /path/to/workdir ONBUILD ADD . /app/src </code></pre> </div> <div class=""> <h2>DOS .bat</h2> <pre><code class="dos">cd \ copy a b ping 192.168.0.1 @rem ping 192.168.0.1 net stop sharedaccess del %tmp% /f /s /q del %temp% /f /s /q ipconfig /flushdns taskkill /F /IM JAVA.EXE /T cd Photoshop/Adobe Photoshop CS3/AMT/ if exist application.sif ( ren application.sif _application.sif ) else ( ren _application.sif application.sif ) taskkill /F /IM proquota.exe /T sfc /SCANNOW set path = test xcopy %1\*.* %2 </code></pre> </div> <div class="template"> <h2>Dust</h2> <pre><code class="dust">&lt;h3&gt;Hours&lt;/h3&gt; &lt;ul&gt; {#users} &lt;li {hello}}&gt;{firstName}&lt;/li&gt;{~n} {/users} &lt;/ul&gt; </code></pre> </div> <div class="functional"> <h2>Elixir</h2> <pre><code class="elixir">defrecord Person, first_name: nil, last_name: &quot;Dudington&quot; do def name record do # huh ? &quot;#{record.first_name} #{record.last_name}&quot; end end defrecord User, name: &quot;José&quot;, age: 25 guy = Person.new first_name: &quot;Guy&quot; guy.name defmodule ListServer do @moduledoc &quot;&quot;&quot; This module provides an easy to use ListServer, useful for keeping lists of things. &quot;&quot;&quot; use GenServer.Behaviour alias Foo.Bar ### Public API @doc &quot;&quot;&quot; Starts and links a new ListServer, returning {:ok, pid} ## Example iex&gt; {:ok, pid} = ListServer.start_link &quot;&quot;&quot; def start_link do :gen_server.start_link({:local, :list}, __MODULE__, [], []) end ### GenServer API def init(list) do {:ok, list} end # Clear the list def handle_cast :clear, list do {:noreply, []} end end {:ok, pid} = ListServer.start_link pid &lt;- {:foo, &quot;bar&quot;} greeter = fn(x) -&gt; IO.puts &quot;hey #{x}&quot; end greeter.(&quot;Bob&quot;) </code></pre> </div> <div class="template"> <h2>ERB (Embedded Ruby)</h2> <pre><code class="erb">&lt;%# this is a comment %&gt; &lt;% @posts.each do |post| %&gt; &lt;p&gt;&lt;%= link_to post.title, post %&gt;&lt;/p&gt; &lt;% end %&gt; &lt;%- available_things = things.select(&amp;:available?) -%&gt; &lt;%%- x = 1 + 2 -%%&gt; &lt;%% value = &#39;real string #{@value}&#39; %%&gt; &lt;%%= available_things.inspect %%&gt; </code></pre> </div> <div class="functional"> <h2>Erlang REPL</h2> <pre><code class="erlang-repl">1&gt; Str = &quot;abcd&quot;. &quot;abcd&quot; 2&gt; L = test:length(Str). 4 3&gt; Descriptor = {L, list_to_atom(Str)}. {4,abcd} 4&gt; L. 4 5&gt; b(). Descriptor = {4,abcd} L = 4 Str = &quot;abcd&quot; ok 6&gt; f(L). ok 7&gt; b(). Descriptor = {4,abcd} Str = &quot;abcd&quot; ok 8&gt; {L, _} = Descriptor. {4,abcd} 9&gt; L. 4 10&gt; 2#101. 5 11&gt; 1.85e+3. 1850 </code></pre> </div> <div class="functional"> <h2>Erlang</h2> <pre><code class="erlang">-module(ssh_cli). -behaviour(ssh_channel). -include(&quot;ssh.hrl&quot;). %% backwards compatibility -export([listen/1, listen/2, listen/3, listen/4, stop/1]). if L =/= [] -&gt; % If L is not empty sum(L) / count(L); true -&gt; error end. %% state -record(state, { cm, channel }). -spec foo(integer()) -&gt; integer(). foo(X) -&gt; 1 + X. test(Foo)-&gt;Foo. init([Shell, Exec]) -&gt; {ok, #state{shell = Shell, exec = Exec}}; init([Shell]) -&gt; false = not true, io:format(&quot;Hello, \&quot;~p!~n&quot;, [atom_to_list(&#39;World&#39;)]), {ok, #state{shell = Shell}}. concat([Single]) -&gt; Single; concat(RList) -&gt; EpsilonFree = lists:filter( fun (Element) -&gt; case Element of epsilon -&gt; false; _ -&gt; true end end, RList), case EpsilonFree of [Single] -&gt; Single; Other -&gt; {concat, Other} end. union_dot_union({union, _}=U1, {union, _}=U2) -&gt; union(lists:flatten( lists:map( fun (X1) -&gt; lists:map( fun (X2) -&gt; concat([X1, X2]) end, union_to_list(U2) ) end, union_to_list(U1) ))). </code></pre> </div> <div class=""> <h2>FIX</h2> <pre><code class="fix">8=FIX.4.2␁9=0␁35=8␁49=SENDERTEST␁56=TARGETTEST␁34=00000001526␁52=20120429-13:30:08.137␁1=ABC12345␁11=2012abc1234␁14=100␁17=201254321␁20=0␁30=NYSE␁31=108.20␁32=100␁38=100␁39=2␁40=1␁47=A␁54=5␁55=BRK␁59=2␁60=20120429-13:30:08.000␁65=B␁76=BROKER␁84=0␁100=NYSE␁111=100␁150=2␁151=0␁167=CS␁377=N␁10000=SampleCustomTag␁10=123␁ 8=FIX.4.29=035=849=SENDERTEST56=TARGETTEST34=0000000152652=20120429-13:30:08.1371=ABC1234511=2012abc123414=10017=20125432120=030=NYSE31=108.2032=10038=10039=240=147=A54=555=BRK59=260=20120429-13:30:08.00065=B76=BROKER84=0100=NYSE111=100150=2151=0167=CS377=N10000=SampleCustomTag10=123 </code></pre> </div> <div class="scientific"> <h2>Fortran</h2> <pre><code class="fortran">subroutine test_sub(k) implicit none !=============================== ! This is a test subroutine !=============================== integer, intent(in) :: k double precision, allocatable :: a(:) integer, parameter :: nmax=10 integer :: i allocate (a(nmax)) do i=1,nmax a(i) = dble(i)*5.d0 enddo print *, &#39;Hello world&#39; write (*,*) a(:) end subroutine test_sub </code></pre> </div> <div class="functional"> <h2>F#</h2> <pre><code class="fsharp">open System // Single line comment... (* This is a multiline comment. *) let checkList alist = match alist with | [] -&gt; 0 | [a] -&gt; 1 | [a; b] -&gt; 2 | [a; b; c] -&gt; 3 | _ -&gt; failwith &quot;List is too big!&quot; let text = &quot;Some text...&quot; let text2 = @&quot;A &quot;&quot;verbatim&quot;&quot; string...&quot; let catalog = &quot;&quot;&quot; Some &quot;long&quot; string... &quot;&quot;&quot; let rec fib x = if x &lt;= 2 then 1 else fib(x-1) + fib(x-2) let fibs = Async.Parallel [ for i in 0..40 -&gt; async { return fib(i) } ] |&gt; Async.RunSynchronously type Sprocket(gears) = member this.Gears : int = gears [&lt;AbstractClass&gt;] type Animal = abstract Speak : unit -&gt; unit type Widget = | RedWidget | GreenWidget type Point = {X: float; Y: float;} [&lt;Measure&gt;] type s let minutte = 60&lt;s&gt; type DefaultMailbox&lt;&#39;a&gt;() = let mutable inbox = ConcurrentQueue&lt;&#39;a&gt;() let awaitMsg = new AutoResetEvent(false) </code></pre> </div> <div class=""> <h2>G-code (ISO 6983)</h2> <pre><code class="gcode">O003 (DIAMOND SQUARE) N2 G54 G90 G49 G80 N3 M6 T1 (1.ENDMILL) N4 M3 S1800 N5 G0 X-.6 Y2.050 N6 G43 H1 Z.1 N7 G1 Z-.3 F50. N8 G41 D1 Y1.45 N9 G1 X0 F20. N10 G2 J-1.45 (CUTTER COMP CANCEL) N11 G1 Z-.2 F50. N12 Y-.990 N13 G40 N14 G0 X-.6 Y1.590 N15 G0 Z.1 N16 M5 G49 G28 G91 Z0 N17 CALL O9456 N18 #500=0.004 N19 #503=[#500+#501] N20 VC45=0.0006 VS4=0.0007 N21 G90 G10 L20 P3 X5.Y4. Z6.567 N22 G0 X5000 N23 IF [#1 LT 0.370] GOTO 49 N24 X-0.678 Y+.990 N25 G84.3 X-0.1 N26 #4=#5*COS[45] N27 #4=#5*SIN[45] N28 VZOFZ=652.9658 % </code></pre> </div> <div class=""> <h2>Gherkin</h2> <pre><code class="gherkin"># language: en Feature: Addition In order to avoid silly mistakes As a math idiot I want to be told the sum of two numbers @this_is_a_tag Scenario Outline: Add two numbers * I have a calculator Given I have entered &lt;input_1&gt; into the calculator And I have entered &lt;input_2&gt; into the calculator When I press &lt;button&gt; Then the result should be &lt;output&gt; on the screen And I have a string like &quot;&quot;&quot; Here is some multiline text &quot;&quot;&quot; Examples: | input_1 | input_2 | button | output | | 20 | 30 | add | 50 | | 2 | 5 | add | 7 | | 0 | 40 | add | 40 | </code></pre> </div> <div class="graphics"> <h2>GLSL</h2> <pre><code class="glsl">// vertex shader #version 150 in vec2 in_Position; in vec3 in_Color; out vec3 ex_Color; void main(void) { gl_Position = vec4(in_Position.x, in_Position.y, 0.0, 1.0); ex_Color = in_Color; } // geometry shader #version 150 layout(triangles) in; layout(triangle_strip, max_vertices = 3) out; void main() { for(int i = 0; i &lt; gl_in.length(); i++) { gl_Position = gl_in[i].gl_Position; EmitVertex(); } EndPrimitive(); } // fragment shader #version 150 precision highp float; in vec3 ex_Color; out vec4 gl_FragColor; void main(void) { gl_FragColor = vec4(ex_Color, 1.0); } </code></pre> </div> <div class="system"> <h2>Go</h2> <pre><code class="go">package main import ( &quot;fmt&quot; &quot;os&quot; ) const ( Sunday = iota numberOfDays // this constant is not exported ) type Foo interface { FooFunc(int, float32) (complex128, []int) } type Bar struct { os.File /* multi-line comment */ PublicData chan int } func main() { ch := make(chan int) ch &lt;- 1 x, ok := &lt;- ch ok = true float_var := 1.0e10 defer fmt.Println(&#39;\&#39;&#39;) defer fmt.Println(&#96;exitting now\&#96;) var fv1 float64 = 0.75 go println(len(&quot;hello world!&quot;)) return } </code></pre> </div> <div class=""> <h2>Gradle</h2> <pre><code class="gradle"> apply plugin: &#39;android&#39; android { compileSdkVersion 19 buildToolsVersion &quot;19.1&quot; defaultConfig { minSdkVersion 15 targetSdkVersion 19 versionCode 5 versionName &quot;0.4.4&quot; } compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } signingConfigs { release } buildTypes { release { // runProguard true proguardFiles getDefaultProguardFile(&#39;proguard-android.txt&#39;), &#39;proguard-rules.txt&#39; signingConfig signingConfigs.release } } } dependencies { compile fileTree(dir: &#39;libs&#39;, include: [&#39;*.jar&#39;]) compile &#39;com.example:example-lib:1.0.0&#39; } def propFile = file(&#39;../signing.properties&#39;) if( propFile.canRead() ) { def Properties p = new Properties() p.load(new FileInputStream(propFile)) if( p!=null &amp;&amp; p.containsKey(&quot;STORE_FILE&quot;) &amp;&amp; p.containsKey(&#39;STORE_PASSWORD&#39;) &amp;&amp; p.containsKey(&#39;KEY_ALIAS&#39;) &amp;&amp; p.containsKey(&#39;KEY_PASSWORD&#39;) ) { println &quot;RELEASE_BUILD: Signing...&quot; android.signingConfigs.release.storeFile = file( p[&#39;STORE_FILE&#39;] ) android.signingConfigs.release.storePassword = p[&#39;STORE_PASSWORD&#39;] android.signingConfigs.release.keyAlias = p[&#39;KEY_ALIAS&#39;] android.signingConfigs.release.keyPassword = p[&#39;KEY_PASSWORD&#39;] } else { println &quot;RELEASE_BUILD: Required properties in signing.properties are missing&quot; android.buildTypes.release.signingConfig = null } } else { println &quot;RELEASE_BUILD: signing.properties not found&quot; android.buildTypes.release.signingProperties = null } </code></pre> </div> <div class=""> <h2>Groovy</h2> <pre><code class="groovy">#!/usr/bin/env groovy package model import groovy.transform.CompileStatic import java.util.List as MyList trait Distributable { void distribute(String version) {} } @CompileStatic class Distribution implements Distributable { double number = 1234.234 / 567 def otherNumber = 3 / 4 boolean archivable = condition ?: true def ternary = a ? b : c String name = &quot;Guillaume&quot; Closure description = null List&lt;DownloadPackage&gt; packages = [] String regex = ~/.*foo.*/ String multi = &#39;&#39;&#39; multi line string &#39;&#39;&#39; + &quot;&quot;&quot; now with double quotes and ${gstring} &quot;&quot;&quot; + $/ even with dollar slashy strings /$ /** * description method * @param cl the closure */ void description(Closure cl) { this.description = cl } void version(String name, Closure versionSpec) { def closure = { println &quot;hi&quot; } as Runnable MyList ml = [1, 2, [a: 1, b:2,c :3]] for (ch in &quot;name&quot;) {} // single line comment DownloadPackage pkg = new DownloadPackage(version: name) check that: true label: def clone = versionSpec.rehydrate(pkg, pkg, pkg) /* now clone() in a multiline comment */ clone() packages.add(pkg) assert 4 / 2 == 2 } } </code></pre> </div> <div class="template"> <h2>Haml</h2> <pre><code class="haml">!!! XML %html %body %h1.jumbo{:id=&gt;&quot;a&quot;, :style=&gt;&#39;font-weight: normal&#39;, :title=&gt;title} highlight.js /html comment -# ignore this line %ul(style=&#39;margin: 0&#39;) -items.each do |i| %i= i = variable =variable2 ~ variable3 ~variable4 The current year is #{DataTime.now.year}. </code></pre> </div> <div class="template"> <h2>Handlebars</h2> <pre><code class="handlebars">&lt;h3&gt;Hours&lt;/h3&gt; &lt;ul&gt; {{#each content.users}} &lt;li {{bindAttr hello=&quot;world&quot;}}&gt;{{firstName}}&lt;/li&gt; {{/each}} &lt;/ul&gt; </code></pre> </div> <div class="functional"> <h2>Haskell</h2> <pre><code class="haskell">{-# LANGUAGE TypeSynonymInstances #-} module Network.UDP ( DataPacket(..) , openBoundUDPPort , openListeningUDPPort , pingUDPPort , sendUDPPacketTo , recvUDPPacket , recvUDPPacketFrom ) where import qualified Data.ByteString as Strict (ByteString, concat, singleton) import qualified Data.ByteString.Lazy as Lazy (ByteString, toChunks, fromChunks) import Data.ByteString.Char8 (pack, unpack) import Network.Socket hiding (sendTo, recv, recvFrom) import Network.Socket.ByteString (sendTo, recv, recvFrom) -- Type class for converting StringLike types to and from strict ByteStrings class DataPacket a where toStrictBS :: a -&gt; Strict.ByteString fromStrictBS :: Strict.ByteString -&gt; a instance DataPacket Strict.ByteString where toStrictBS = id {-# INLINE toStrictBS #-} fromStrictBS = id {-# INLINE fromStrictBS #-} openBoundUDPPort :: String -&gt; Int -&gt; IO Socket openBoundUDPPort uri port = do s &lt;- getUDPSocket bindAddr &lt;- inet_addr uri let a = SockAddrInet (toEnum port) bindAddr bindSocket s a return s pingUDPPort :: Socket -&gt; SockAddr -&gt; IO () pingUDPPort s a = sendTo s (Strict.singleton 0) a &gt;&gt; return () </code></pre> </div> <div class=""> <h2>Haxe</h2> <pre><code class="haxe"> // quicksort example from http://haxe.org/doc/snip/quicksort class Quicksort { static var arr = [4,8,0,3,9,1,5,2,6,7]; static function quicksort( lo : Int, hi : Int ) : Void { var i = lo; var j = hi; var buf = arr; var p = buf[(lo+hi)&gt;&gt;1]; while( i &lt;= j ) { while( arr[i] &gt; p ) i++; while( arr[j] &lt; p ) j--; if( i &lt;= j ) { var t = buf[i]; buf[i++] = buf[j]; buf[j--] = t; } } if( lo &lt; j ) quicksort( lo, j ); if( i &lt; hi ) quicksort( i, hi ); } static function main() { quicksort( 0, arr.length-1 ); trace(arr); } } </code></pre> </div> <div class="common protocols"> <h2>HTTP</h2> <pre><code class="http">POST /task?id=1 HTTP/1.1 Host: example.org Content-Type: application/json; charset=utf-8 Content-Length: 19 {&quot;status&quot;: &quot;ok&quot;, &quot;extended&quot;: true} </code></pre> </div> <div class="common config"> <h2>Ini</h2> <pre><code class="ini">;Settings relating to the location and loading of the database [Database] ProfileDir=. ShowProfileMgr=smart Profile1_Name[] = &quot;\|/_-=MegaDestoyer=-_\|/&quot; DefaultProfile=True AutoCreate = no [AutoExec] use-prompt=&quot;prompt&quot; Glob=autoexec_*.ini AskAboutIgnoredPlugins=0 </code></pre> </div> <div class="common enterprise"> <h2>Java</h2> <pre><code class="java">/** * @author John Smith &lt;john.smith@example.com&gt; * @version 1.0 */ package l2f.gameserver.model; import java.util.ArrayList; public abstract class L2Character extends L2Object { public static final Short ABNORMAL_EFFECT_BLEEDING = 0x0_0_0_1; // not sure public void moveTo(int x, int y, int z) { _ai = null; _log.warning(&quot;Should not be called&quot;); if (1 &gt; 5) { return; } } /** Task of AI notification */ @SuppressWarnings( { &quot;nls&quot;, &quot;unqualified-field-access&quot;, &quot;boxing&quot; }) public class NotifyAITask implements Runnable { private final CtrlEvent _evt; List&lt;String&gt; mList = new ArrayList&lt;String&gt;() public void run() { try { getAI().notifyEvent(_evt, _evt.class, null); } catch (Throwable t) { t.printStackTrace(); } } } } </code></pre> </div> <div class="common scripting"> <h2>JavaScript</h2> <pre><code class="javascript">import {x, y} as p from &#39;point&#39;; const ANSWER = 42; class Car extends Vehicle { constructor(speed, cost) { super(speed); var c = Symbol(&#39;cost&#39;); this[c] = cost; this.intro = &#96;This is a car runs at ${speed}.&#96;; } } for (let num of [1, 2, 3]) { console.log(num + 0b111110111); } function $initHighlight(block, flags) { try { if (block.className.search(/\bno\-highlight\b/) != -1) return processBlock(block.function, true, 0x0F) + &#39; class=&quot;&quot;&#39;; } catch (e) { /* handle exception */ var e4x = &lt;div&gt;Example &lt;p&gt;1234&lt;/p&gt;&lt;/div&gt;; } for (var i = 0 / 2; i &lt; classes.length; i++) { // &quot;0 / 2&quot; should not be parsed as regexp if (checkCondition(classes[i]) === undefined) return /\d+[\s/]/g; } console.log(Array.every(classes, Boolean)); } export $initHighlight; </code></pre> </div> <div class="common protocols"> <h2>JSON</h2> <pre><code class="json">[ { &quot;title&quot;: &quot;apples&quot;, &quot;count&quot;: [12000, 20000], &quot;description&quot;: {&quot;text&quot;: &quot;...&quot;, &quot;sensitive&quot;: false} }, { &quot;title&quot;: &quot;oranges&quot;, &quot;count&quot;: [17500, null], &quot;description&quot;: {&quot;text&quot;: &quot;...&quot;, &quot;sensitive&quot;: false} } ] </code></pre> </div> <div class=""> <h2>Julia</h2> <pre><code class="julia">using Profile # type definition immutable Point{T&lt;:FloatingPoint} index::Int x::T y::T end #= Multi Line Comment =# function method0(x, y::Int; version::VersionNumber=v&quot;0.1.2&quot;) &quot;&quot;&quot; Triple Quoted String &quot;&quot;&quot; @assert π &gt; e s = 1.2 変数 = &quot;variable&quot; if s * 100_000 ≥ 5.2e+10 &amp;&amp; true || is(x, nothing) s = 1. + .5im elseif 1 ∈ [1, 2, 3] println(&quot;s is $s and 変数 is $変数&quot;) else x = [1 2 3; 4 5 6] @show x&#39; end local var = rand(10) var[1:5] var[5:end-1] var[end] opt = &quot;-la&quot; run(&#96;ls $opt&#96;) &#39;\u2200&#39; != &#39;T&#39; return 5s / 2 end </code></pre> </div> <div class="misc"> <h2>Kotlin</h2> <pre><code class="kotlin">import kotlin.lang.test trait A { fun x() } fun xxx() : Int { return 888 } public fun main(args : Array&lt;String&gt;) { } </code></pre> </div> <div class=""> <h2>Lasso</h2> <pre><code class="lasso">&lt;?LassoScript /* Lasso 8 */ local(&#39;query&#39; = &#39;SELECT * FROM &#96;&#39;+var:&#39;table&#39;+&#39;&#96; WHERE &#96;id&#96; &gt; 10 ORDER BY &#96;Name&#96; LIMIT 30&#39;); Inline: -Username=$DBuser, -Password=$DBpass, -Database=$DBname, -sql=#query; var(&quot;class1.name&quot; = (found_count != 0 ? &quot;subtotal&quot; | &quot;nonefound&quot;), &quot;total_amount&quot; = found_count); records; output: &quot;&lt;tr&gt;&quot;loop_count&quot;&lt;/tr&gt;&quot;; /records; /Inline; ?&gt;&lt;div class=&quot;[$class1.name]&quot;&gt;[$total_amount]&lt;/div&gt; &lt;?lasso /* Lasso 9 */ ?&gt; [noprocess] causes [delimiters] to be &lt;?=skipped?&gt; until the next [/noprocess] [ define strings_combine(value::string, ...other)::string =&gt; { local(result = #value-&gt;append(#other-&gt;asString&amp;trim)) return #result } /**! descriptive text */ define person =&gt; type { parent entity data name::string, protected nickname, birthdate :: date data private ssn = null private showAge() =&gt; { return ..age } protected fullName() =&gt; &#96;&quot;&#96; + .nickname + &#96;&quot;&#96; + .&#39;name&#39; public ssnListed::boolean =&gt; .ssn() ? true | false } define person-&gt;name=(value) =&gt; { .&#39;name&#39; = #value return self-&gt;&#39;name&#39; } ] &lt;!-- an HTML comment &lt;?=disables delimiters?&gt; as well --&gt; [no_square_brackets] disables [square brackets] for the rest of the file &lt;?= // query expression with n in array((:-12, 0xABCD, 3.14159e14), (:NaN, -infinity, .57721)) let swapped = pair(#n-&gt;second, #n-&gt;first) group #swapped by #n-&gt;first into t let key = #t-&gt;key order by #key select pair(#key, #1) do {^ #n-&gt;upperCase ^} ?&gt; </code></pre> </div> <div class="css"> <h2>Less</h2> <pre><code class="less">/* Using the most minimal language subset to ensure we have enough relevance hints for proper Less detection */ @import &quot;fruits&quot;; @rhythm: 1.5em; @media screen and (min-resolution: 2dppx) { body {font-size: 125%} } section &gt; .foo + #bar:hover [href*=&quot;less&quot;] { margin: @rhythm 0 0 @rhythm; padding: calc(5% + 20px); background: #f00ba7 url(http://placehold.alpha-centauri/42.png) no-repeat; background-image: linear-gradient(-135deg, wheat, fuchsia) !important ; background-blend-mode: multiply; } @font-face { font-family: /* ? */ &#39;Omega&#39;; src: url(&#39;../fonts/omega-webfont.woff?v=2.0.2&#39;); } .icon-baz::before { display: inline-block; font-family: &quot;Omega&quot;, Alpha, sans-serif; content: &quot;\f085&quot;; color: rgba(98, 76 /* or 54 */, 231, .75); } </code></pre> </div> <div class="lisp"> <h2>Lisp</h2> <pre><code class="lisp">#!/usr/bin/env csi (defun prompt-for-cd () &quot;Prompts for CD&quot; (prompt-read &quot;Title&quot; 1.53 1 2/4 1.7 1.7e0 2.9E-4 +42 -7 #b001 #b001/100 #o777 #O777 #xabc55 #c(0 -5.6)) (prompt-read &quot;Artist&quot; &amp;rest) (or (parse-integer (prompt-read &quot;Rating&quot;) :junk-allowed t) 0) (if x (format t &quot;yes&quot;) (format t &quot;no&quot; nil) ;and here comment ) ;; second line comment &#39;(+ 1 2) (defvar *lines*) ; list of all lines (position-if-not #&#39;sys::whitespacep line :start beg)) (quote (privet 1 2 3)) &#39;(hello world) (* 5 7) (1 2 34 5) (:use &quot;aaaa&quot;) (let ((x 10) (y 20)) (print (+ x y)) )</code></pre> </div> <div class="enterprise"> <h2>LiveCode</h2> <pre><code class="livecodeserver">&lt;?rev global gControllerHandlers, gData local sTest put &quot;blog,index&quot; into gControllerHandlers command blog -- simple comment put &quot;Hello World!&quot; into sTest # ANOTHER COMMENT put &quot;form,url,asset&quot; into tHelpers rigLoadHelper tHelpers end blog /*Hello block comment!*/ function myFunction if the secs &gt; 2000000000 then put &quot;Welcome to the future!&quot; else return &quot;something&quot; end if end myFunction --| END OF blog.lc --| Location: ./system/application/controllers/blog.lc ---------------------------------------------------------------------- </code></pre> </div> <div class="scripting"> <h2>LiveScript</h2> <pre><code class="livescript"># take the first n objects from a list take = (n, [x, ...xs]:list) --&gt; | n &lt;= 0 =&gt; [] | empty list =&gt; [] | otherwise =&gt; [x] ++ take n - 1, xs take 2, [1, 2, 3, 4, 5] # Curried functions take-three = take 3 take-three [6, 7, 8, 9, 10] # Function composition last-three = reverse &gt;&gt; take-three &gt;&gt; reverse last-three [1 to 8] # List comprehensions and piping t1 = * id: 1 name: &#39;george&#39; * id: 2 name: &#39;mike&#39; * id: 3 name: &#39;donald&#39; t2 = * id: 2 age: 21 * id: 1 age: 20 * id: 3 age: 26 [{id:id1, name, age} for {id:id1, name} in t1 for {id:id2, age} in t2 where id1 is id2] |&gt; sort-by \id |&gt; JSON.stringify </code></pre> </div> <div class="scripting"> <h2>Lua</h2> <pre><code class="lua">--[[ Simple signal/slot implementation ]] local signal_mt = { __index = { register = table.insert } } function signal_mt.__index:emit(... --[[ Comment in params ]]) for _, slot in ipairs(self) do slot(self, ...) end end local function create_signal() return setmetatable({}, signal_mt) end -- Signal test local signal = create_signal() signal:register(function(signal, ...) print(...) end) signal:emit(&#39;Answer to Life, the Universe, and Everything:&#39;, 42) --[==[ [=[ [[ Nested ]] multi-line ]=] comment ]==] [==[ Nested [=[ multi-line [[ string ]] ]=] ]==] </code></pre> </div> <div class="common"> <h2>Makefile</h2> <pre><code class="makefile"># Makefile BUILDDIR = _build EXTRAS ?= $(BUILDDIR)/extras .PHONY: main clean main: @echo &quot;Building main facility...&quot; build_main $(BUILDDIR) clean: rm -rf $(BUILDDIR)/* </code></pre> </div> <div class="common"> <h2>Markdown</h2> <pre><code class="markdown"># hello world you can write text [with links](http://example.com) inline or [link references][1]. * one _thing_ has *em*phasis * two __things__ are **bold** [1]: http://example.com --- hello world =========== &lt;this_is inline=&quot;xml&quot;&gt;&lt;/this_is&gt; &gt; markdown is so cool so are code segments 1. one thing (yeah!) 2. two thing &#96;i can write code&#96;, and &#96;more&#96; wipee! </code></pre> </div> <div class="scientific"> <h2>Mathematica</h2> <pre><code class="mathematica">(* ::Package:: *) (* Mathematica Package *) BeginPackage[&quot;SomePkg&#96;&quot;] Begin[&quot;&#96;Private&#96;&quot;] SomeFn[ns_List] := Fold[Function[{x, y