syntax-highlighting
Version:
Syntax Highlighting Colorschemes for many applications
2,041 lines (1,693 loc) • 108 kB
HTML
<!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">#Если Клиент Тогда
Перем СимвольныйКодКаталога = "ля-ля-ля"; //комментарий
Функция Сообщить(Знач ТекстСообщения, ТекстСообщения2) Экспорт //комментарий к функции
x=ТекстСообщения+ТекстСообщения2+"
|строка1
|строка2
|строка3";
КонецФункции
#КонецЕсли
// Процедура ПриНачалеРаботыСистемы
//
Процедура ПриНачалеРаботыСистемы()
Обработки.Помощник.ПолучитьФорму("Форма").Открыть();
d = '21.01.2008'
КонецПроцедуры
</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`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 "access plus 1 days"
Order Deny,Allow
Allow from All
<Location /maps/>
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]
</Location>
</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 "Hello there"
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 "/bin/echo 'hello'"
</code></pre>
</div>
<div class="">
<h2>AsciiDoc</h2>
<pre><code class="asciidoc">Hello, World!
============
Author Name, <author@domain.foo>
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 'emphasis'
** 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+
* `smart' quotes using a leading backtick and trailing single quote
** use two of each for double ``smart'' quotes
- escape characters are supported
- you can escape a quote inside emphasized text like 'here\'s johnny!'
term:: definition
another term:: another definition
// this is just a comment
Let's make a break.
'''
////
we'll be right with you
after this brief interruption.
////
== We're back!
Want to see a image::images/tiger.png[Tiger]?
.Nested highlighting
++++
<this_is inline="xml"></this_is>
++++
____
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'll join that party, too.
....
. one thing (yeah!)
. two thing `i can write code`, and `more` 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) && args(Account, .., int);
@AdviceName("CheckValidEmail")
before (Customer hu) : getResult(hu){
System.out.println("Your mail address is valid!");
}
Object around() throws InsufficientBalanceException: getResult() && 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*(*)) && args(newValue) && this(bean);
declare parents: banking.entities.* implements BeanSupport;
declare warning : call(void TestSoftening.perform()): "Please ensure you are not calling this from an AWT thread";
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 (`%) need to be escaped.
Run "C:\Program Files\some\program.exe"
Gosub, label1
return
::btw::by the way
; volume
#Numpad8::Send {Volume_Up}
#Numpad5::Send {Volume_Mute}
#Numpad2::Send {Volume_Down}
label1:
if (Clipboard = "")
{
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 "8515def.inc"
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="/root/.hag_accepted.conf"
BE_VERBOSE=false
###### END CONFIG
if [ "$UID" -ne 0 ]
then
echo "Superuser rights is required"
echo 'Printing the # sign'
exit 2
fi
if test $# -eq 0
then
elif test [ $1 == 'start' ]
else
fi
genApacheConf(){
if [[ "$2" = "www" ]]
then
full_domain=$1
else
full_domain=$2.$1
fi
host_root="${APACHE_HOME_DIR}$1/$2/$(title)"
echo -e "# Host $1/$2 :"
}
</code></pre>
</div>
<div class="">
<h2>Brainfuck</h2>
<pre><code class="brainfuck">++++++++++
[ 3*10 and 10*10
->+++>++++++++++<<
]>>
[ filling cells
->++>>++>++>+>++>>++>++>++>++>++>++>++>++>++>++>++[</]<[<]<[<]>>
]<
+++++++++<<
[ rough codes correction loop
->>>+>+>+>+++>+>+>+>+>+>+>+>+>+>+>+>+>+>+[<]<
]
more accurate сodes correction
>>>++>
-->+++++++>------>++++++>++>+++++++++>++++++++++>++++++++>--->++++++++++>------>++++++>
++>+++++++++++>++++++++++++>------>+++
rewind and output
[<]>[.>]
</code></pre>
</div>
<div class="protocols">
<h2>Cap’n Proto</h2>
<pre><code class="capnproto">@0xdbb9ad1f14bf0b36; # unique file ID, generated by `capnp id`
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 () -> (result :Bool);
}
interface Directory extends(Node) {
list @0 () -> (list: List(Entry));
struct Entry {
name @0 :Text;
node @1 :Node;
}
create @1 (name :Text) -> (file :File);
mkdir @2 (name :Text) -> (directory :Directory)
open @3 (name :Text) -> (node :Node);
delete @4 (name :Text);
link @5 (name :Text, node :Node);
}
interface File extends(Node) {
size @0 () -> (size: UInt64);
read @1 (startAt :UInt64 = 0, amount :UInt64 = 0xffffffffffffffff)
-> (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=> (defn f [x y]
#_=> (+ x y))
#'user/f
user=> (f 5 7)
12
user=> nil
nil
</code></pre>
</div>
<div class="lisp">
<h2>Clojure</h2>
<pre><code class="clojure">; Comment
(def
^{:macro true
:added "1.0"}
let (fn* let [&form &env & decl] (cons '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("Good choice, bro!")
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={"A": "Excellent"}) ->
if student.excellentWork
"A+"
else if student.okayStuff
if student.triedHard then "B" else "B-"
else
"C"
square = (x) -> x * x
two = -> 2
math =
root: Math.sqrt
square: square
cube: (x) -> x * square x
race = (winner, runners...) ->
print winner, runners
class Animal extends Being
constructor: (@name) ->
move: (meters) ->
alert @name + " moved #{meters}m."
hi = `function() {
return [document.title, "Hello JavaScript"].join(": ");
}`
heredoc = """
CoffeeScript subst test #{ 010 + 0xf / 0b10 + "nested string #{ /\n/ }"}
"""
###
CoffeeScript Compiler v1.2.0
Released under the MIT License
###
OPERATOR = /// ^ (
?: [-=]> # function
) ///
</code></pre>
</div>
<div class="common system">
<h2>C++</h2>
<pre><code class="cpp">#include <iostream>
#define IABS(x) ((x) < 0 ? -(x) : (x))
int main(int argc, char *argv[]) {
/* An annoying "Hello World" example */
for (auto i = 0; i < 0xFFFF; i++)
cout << "Hello, World!" << endl;
char c = '\n';
unordered_map <string, vector<string> > m;
m["key"] = "\\\\"; // 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
{
/// <summary>The entry point to the program.</summary>
public static int Main(string[] args)
{
Console.WriteLine("Hello, World!");
string s = @"This
""string""
spans
multiple
lines!";
dynamic x = new ExpandoObject();
x.MyProperty = 2;
return 0;
}
}
async Task<int> AccessTheWebAsync()
{
// ...
string urlContents = await getStringTask;
return urlContents.Length;
}
internal static void ExceptionFilters()
{
try
{
throw new Exception();
}
catch (Exception e) when (e.Message == "My error") { }
}</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: 'highlight: ' attr(class);
}
body {
background: linear-gradient(45deg, blue, red);
}
}
@import url('print.css');
@page:right {
margin: 1cm 2cm 1.3cm 4cm;
}
@font-face {
font-family: Chunkfive; src: url('Chunkfive.otf');
}
div.text,
#content,
li[lang=ru] {
font: Tahoma, Chunkfive, sans-serif;
background: url('hatch.png') /* 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 = '©';
enum copy_valid = '&copy;';
enum backslash_escaped = '\\';
// string literals
enum str = `hello "world"!`;
enum multiline = r"lorem
ipsum
dolor"; // wysiwyg string, no escapes here allowed
enum multiline2 = "sit
amet
\"adipiscing\"
elit.";
enum hex = x"66 6f 6f"; // same as "foo"
#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("Average line length: ",
lines ? sumLength / lines : 0);
}
</code></pre>
</div>
<div class="scripting">
<h2>Dart</h2>
<pre><code class="dart">library app;
import 'dart:html';
part 'app2.dart';
/**
* Class description and [link](http://dartlang.org/).
*/
@Awesome('it works!')
class SomeClass<S extends Iterable> extends BaseClass<S> 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) => a + b;
ElementList els() => querySelectorAll('.dart');
}
String str = ' (${'parameter' + 'zxc'})';
String str = " (${true ? 2 + 2 / 2 : null})";
String str = r'\nraw\';
String str = r"\nraw\";
var str = '''
Something ${2+3}
''';
var str = r"""
Something ${2+3}
""";
</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<>BufSize;
Log('File ''' + InFileName + ''' copied'#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: ['comment', 'title', 'setting'],
illegal: '[^\\s]'
},
*** /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 #}
<tr class="{% cycle odd,even %}">
<td>{{ article|default:"Hi... "|escape }}</td>
<td {% if article.today %}class="today"{% endif %}>{{ article.date|date:'d.m.Y' }}</td>
</tr>
{% endfor %}
{% endif %}
{% comment %}
Comments may be long and multiline.
Markup is <em>not</em> 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 && apt-get install -y software-properties-common\
zsh curl wget git htop\
unzip vim telnet
RUN ["/bin/bash", "-c", "echo hello ${USER}"]
CMD ["executable","param1","param2"]
CMD command param1 param2
EXPOSE 1337
ENV myName="John Doe" 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 "hom"
ADD hom?.txt /mydir/ # ? is replaced with any single character
COPY hom* /mydir/ # adds all files starting with "hom"
COPY hom?.txt /mydir/ # ? is replaced with any single character
ENTRYPOINT ["executable", "param1", "param2"]
ENTRYPOINT command param1 param2
VOLUME ["/data"]
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"><h3>Hours</h3>
<ul>
{#users}
<li {hello}}>{firstName}</li>{~n}
{/users}
</ul>
</code></pre>
</div>
<div class="functional">
<h2>Elixir</h2>
<pre><code class="elixir">defrecord Person, first_name: nil, last_name: "Dudington" do
def name record do # huh ?
"#{record.first_name} #{record.last_name}"
end
end
defrecord User, name: "José", age: 25
guy = Person.new first_name: "Guy"
guy.name
defmodule ListServer do
@moduledoc """
This module provides an easy to use ListServer, useful for keeping
lists of things.
"""
use GenServer.Behaviour
alias Foo.Bar
### Public API
@doc """
Starts and links a new ListServer, returning {:ok, pid}
## Example
iex> {:ok, pid} = ListServer.start_link
"""
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 <- {:foo, "bar"}
greeter = fn(x) -> IO.puts "hey #{x}" end
greeter.("Bob")
</code></pre>
</div>
<div class="template">
<h2>ERB (Embedded Ruby)</h2>
<pre><code class="erb"><%# this is a comment %>
<% @posts.each do |post| %>
<p><%= link_to post.title, post %></p>
<% end %>
<%- available_things = things.select(&:available?) -%>
<%%- x = 1 + 2 -%%>
<%% value = 'real string #{@value}' %%>
<%%= available_things.inspect %%>
</code></pre>
</div>
<div class="functional">
<h2>Erlang REPL</h2>
<pre><code class="erlang-repl">1> Str = "abcd".
"abcd"
2> L = test:length(Str).
4
3> Descriptor = {L, list_to_atom(Str)}.
{4,abcd}
4> L.
4
5> b().
Descriptor = {4,abcd}
L = 4
Str = "abcd"
ok
6> f(L).
ok
7> b().
Descriptor = {4,abcd}
Str = "abcd"
ok
8> {L, _} = Descriptor.
{4,abcd}
9> L.
4
10> 2#101.
5
11> 1.85e+3.
1850
</code></pre>
</div>
<div class="functional">
<h2>Erlang</h2>
<pre><code class="erlang">-module(ssh_cli).
-behaviour(ssh_channel).
-include("ssh.hrl").
%% backwards compatibility
-export([listen/1, listen/2, listen/3, listen/4, stop/1]).
if L =/= [] -> % If L is not empty
sum(L) / count(L);
true ->
error
end.
%% state
-record(state, {
cm,
channel
}).
-spec foo(integer()) -> integer().
foo(X) -> 1 + X.
test(Foo)->Foo.
init([Shell, Exec]) ->
{ok, #state{shell = Shell, exec = Exec}};
init([Shell]) ->
false = not true,
io:format("Hello, \"~p!~n", [atom_to_list('World')]),
{ok, #state{shell = Shell}}.
concat([Single]) -> Single;
concat(RList) ->
EpsilonFree = lists:filter(
fun (Element) ->
case Element of
epsilon -> false;
_ -> true
end
end,
RList),
case EpsilonFree of
[Single] -> Single;
Other -> {concat, Other}
end.
union_dot_union({union, _}=U1, {union, _}=U2) ->
union(lists:flatten(
lists:map(
fun (X1) ->
lists:map(
fun (X2) ->
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 *, 'Hello world'
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
| [] -> 0
| [a] -> 1
| [a; b] -> 2
| [a; b; c] -> 3
| _ -> failwith "List is too big!"
let text = "Some text..."
let text2 = @"A ""verbatim"" string..."
let catalog = """
Some "long" string...
"""
let rec fib x = if x <= 2 then 1 else fib(x-1) + fib(x-2)
let fibs =
Async.Parallel [ for i in 0..40 -> async { return fib(i) } ]
|> Async.RunSynchronously
type Sprocket(gears) =
member this.Gears : int = gears
[<AbstractClass>]
type Animal =
abstract Speak : unit -> unit
type Widget =
| RedWidget
| GreenWidget
type Point = {X: float; Y: float;}
[<Measure>]
type s
let minutte = 60<s>
type DefaultMailbox<'a>() =
let mutable inbox = ConcurrentQueue<'a>()
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 <input_1> into the calculator
And I have entered <input_2> into the calculator
When I press <button>
Then the result should be <output> on the screen
And I have a string like
"""
Here is
some
multiline text
"""
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 < 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 (
"fmt"
"os"
)
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 <- 1
x, ok := <- ch
ok = true
float_var := 1.0e10
defer fmt.Println('\'')
defer fmt.Println(`exitting now\`)
var fv1 float64 = 0.75
go println(len("hello world!"))
return
}
</code></pre>
</div>
<div class="">
<h2>Gradle</h2>
<pre><code class="gradle">
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion "19.1"
defaultConfig {
minSdkVersion 15
targetSdkVersion 19
versionCode 5
versionName "0.4.4"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
signingConfigs {
release
}
buildTypes {
release {
// runProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
signingConfig signingConfigs.release
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.example:example-lib:1.0.0'
}
def propFile = file('../signing.properties')
if( propFile.canRead() ) {
def Properties p = new Properties()
p.load(new FileInputStream(propFile))
if( p!=null
&& p.containsKey("STORE_FILE")
&& p.containsKey('STORE_PASSWORD')
&& p.containsKey('KEY_ALIAS')
&& p.containsKey('KEY_PASSWORD')
) {
println "RELEASE_BUILD: Signing..."
android.signingConfigs.release.storeFile = file( p['STORE_FILE'] )
android.signingConfigs.release.storePassword = p['STORE_PASSWORD']
android.signingConfigs.release.keyAlias = p['KEY_ALIAS']
android.signingConfigs.release.keyPassword = p['KEY_PASSWORD']
} else {
println "RELEASE_BUILD: Required properties in signing.properties are missing"
android.buildTypes.release.signingConfig = null
}
} else {
println "RELEASE_BUILD: signing.properties not found"
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 = "Guillaume"
Closure description = null
List<DownloadPackage> packages = []
String regex = ~/.*foo.*/
String multi = '''
multi line string
''' + """
now with double quotes and ${gstring}
""" + $/
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 "hi" } as Runnable
MyList ml = [1, 2, [a: 1, b:2,c :3]]
for (ch in "name") {}
// 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=>"a", :style=>'font-weight: normal', :title=>title} highlight.js
/html comment
-# ignore this line
%ul(style='margin: 0')
-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"><h3>Hours</h3>
<ul>
{{#each content.users}}
<li {{bindAttr hello="world"}}>{{firstName}}</li>
{{/each}}
</ul>
</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 -> Strict.ByteString
fromStrictBS :: Strict.ByteString -> a
instance DataPacket Strict.ByteString where
toStrictBS = id
{-# INLINE toStrictBS #-}
fromStrictBS = id
{-# INLINE fromStrictBS #-}
openBoundUDPPort :: String -> Int -> IO Socket
openBoundUDPPort uri port = do
s <- getUDPSocket
bindAddr <- inet_addr uri
let a = SockAddrInet (toEnum port) bindAddr
bindSocket s a
return s
pingUDPPort :: Socket -> SockAddr -> IO ()
pingUDPPort s a = sendTo s (Strict.singleton 0) a >> 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)>>1];
while( i <= j ) {
while( arr[i] > p ) i++;
while( arr[j] < p ) j--;
if( i <= j ) {
var t = buf[i];
buf[i++] = buf[j];
buf[j--] = t;
}
}
if( lo < j ) quicksort( lo, j );
if( i < 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
{"status": "ok", "extended": 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[] = "\|/_-=MegaDestoyer=-_\|/"
DefaultProfile=True
AutoCreate = no
[AutoExec]
use-prompt="prompt"
Glob=autoexec_*.ini
AskAboutIgnoredPlugins=0
</code></pre>
</div>
<div class="common enterprise">
<h2>Java</h2>
<pre><code class="java">/**
* @author John Smith <john.smith@example.com>
* @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("Should not be called");
if (1 > 5) {
return;
}
}
/** Task of AI notification */
@SuppressWarnings( { "nls", "unqualified-field-access", "boxing" })
public class NotifyAITask implements Runnable {
private final CtrlEvent _evt;
List<String> mList = new ArrayList<String>()
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 'point';
const ANSWER = 42;
class Car extends Vehicle {
constructor(speed, cost) {
super(speed);
var c = Symbol('cost');
this[c] = cost;
this.intro = `This is a car runs at
${speed}.`;
}
}
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) + ' class=""';
} catch (e) {
/* handle exception */
var e4x =
<div>Example
<p>1234</p></div>;
}
for (var i = 0 / 2; i < classes.length; i++) { // "0 / 2" 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">[
{
"title": "apples",
"count": [12000, 20000],
"description": {"text": "...", "sensitive": false}
},
{
"title": "oranges",
"count": [17500, null],
"description": {"text": "...", "sensitive": false}
}
]
</code></pre>
</div>
<div class="">
<h2>Julia</h2>
<pre><code class="julia">using Profile
# type definition
immutable Point{T<:FloatingPoint}
index::Int
x::T
y::T
end
#=
Multi
Line
Comment
=#
function method0(x, y::Int; version::VersionNumber=v"0.1.2")
"""
Triple
Quoted
String
"""
@assert π > e
s = 1.2
変数 = "variable"
if s * 100_000 ≥ 5.2e+10 && true || is(x, nothing)
s = 1. + .5im
elseif 1 ∈ [1, 2, 3]
println("s is $s and 変数 is $変数")
else
x = [1 2 3; 4 5 6]
@show x'
end
local var = rand(10)
var[1:5]
var[5:end-1]
var[end]
opt = "-la"
run(`ls $opt`)
'\u2200' != 'T'
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<String>) {
}
</code></pre>
</div>
<div class="">
<h2>Lasso</h2>
<pre><code class="lasso"><?LassoScript
/* Lasso 8 */
local('query' = 'SELECT * FROM `'+var:'table'+'` WHERE `id` > 10
ORDER BY `Name` LIMIT 30');
Inline: -Username=$DBuser, -Password=$DBpass, -Database=$DBname, -sql=#query;
var("class1.name" = (found_count != 0 ? "subtotal" | "nonefound"),
"total_amount" = found_count);
records;
output: "<tr>"loop_count"</tr>";
/records;
/Inline;
?><div class="[$class1.name]">[$total_amount]</div>
<?lasso
/* Lasso 9 */ ?>
[noprocess] causes [delimiters] to be <?=skipped?> until the next [/noprocess]
[
define strings_combine(value::string, ...other)::string => {
local(result = #value->append(#other->asString&trim))
return #result
}
/**! descriptive text */
define person => type {
parent entity
data name::string, protected nickname, birthdate :: date
data private ssn = null
private showAge() => { return ..age }
protected fullName() => `"` + .nickname + `"` + .'name'
public ssnListed::boolean => .ssn() ? true | false
}
define person->name=(value) => {
.'name' = #value
return self->'name'
}
] <!-- an HTML comment <?=disables delimiters?> as well -->
[no_square_brackets] disables [square brackets] for the rest of the file
<?=
// query expression
with n in array((:-12, 0xABCD, 3.14159e14), (:NaN, -infinity, .57721))
let swapped = pair(#n->second, #n->first)
group #swapped by #n->first into t
let key = #t->key
order by #key
select pair(#key, #1)
do {^
#n->upperCase
^}
?>
</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 "fruits";
@rhythm: 1.5em;
@media screen and (min-resolution: 2dppx) {
body {font-size: 125%}
}
section > .foo + #bar:hover [href*="less"] {
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: /* ? */ 'Omega';
src: url('../fonts/omega-webfont.woff?v=2.0.2');
}
.icon-baz::before {
display: inline-block;
font-family: "Omega", Alpha, sans-serif;
content: "\f085";
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 ()
"Prompts
for CD"
(prompt-read "Title" 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 "Artist" &rest)
(or (parse-integer (prompt-read "Rating") :junk-allowed t) 0)
(if x (format t "yes") (format t "no" nil) ;and here comment
)
;; second line comment
'(+ 1 2)
(defvar *lines*) ; list of all lines
(position-if-not #'sys::whitespacep line :start beg))
(quote (privet 1 2 3))
'(hello world)
(* 5 7)
(1 2 34 5)
(:use "aaaa")
(let ((x 10) (y 20))
(print (+ x y))
)</code></pre>
</div>
<div class="enterprise">
<h2>LiveCode</h2>
<pre><code class="livecodeserver"><?rev
global gControllerHandlers, gData
local sTest
put "blog,index" into gControllerHandlers
command blog
-- simple comment
put "Hello World!" into sTest
# ANOTHER COMMENT
put "form,url,asset" into tHelpers
rigLoadHelper tHelpers
end blog
/*Hello
block comment!*/
function myFunction
if the secs > 2000000000 then
put "Welcome to the future!"
else
return "something"
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) -->
| n <= 0 => []
| empty list => []
| otherwise => [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 >> take-three >> reverse
last-three [1 to 8]
# List comprehensions and piping
t1 =
* id: 1
name: 'george'
* id: 2
name: 'mike'
* id: 3
name: 'donald'
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]
|> sort-by \id
|> 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('Answer to Life, the Universe, and Everything:', 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 "Building main facility..."
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
===========
<this_is inline="xml"></this_is>
> markdown is so cool
so are code segments
1. one thing (yeah!)
2. two thing `i can write code`, and `more` wipee!
</code></pre>
</div>
<div class="scientific">
<h2>Mathematica</h2>
<pre><code class="mathematica">(* ::Package:: *)
(* Mathematica Package *)
BeginPackage["SomePkg`"]
Begin["`Private`"]
SomeFn[ns_List] := Fold[Function[{x, y