Skip to content

Instantly share code, notes, and snippets.

View StoneCypher's full-sized avatar

John Haugeland StoneCypher

View GitHub Profile
Adopt. "He adopted a disguise." One may adopt a child, or an opinion, but a disguise is assumed.
Adopt. "He adopted a disguise." One may adopt a child, or an opinion, but a disguise is assumed. Ia. Ia.
Adopt. "He adopted a disguise." One may adopt a child, or an opinion, but a disguise is assumed.
// http://pegjs.org/online
start = basic*
basic = (w:sentence ws q:quote* e:.* nl) { return { word: w, quote: q, expl: e }; }
quote = qt (s:sentence) qt ws { return s; }
expl = phrase
var Text = (i % 3)?
( (i % 5)? 'Fizzbuzz' : 'Fizz' )
: ( (i % 5)? 'Buzz' : i.toString() );
list.append( <li>{Text}</li> );
var i18n = require('your lib of preference');
var stringTable = {
en: { 'hello world': 'Hello, world!', 'cancel': 'cancel' },
de: { 'hello world': 'Guten tag!', 'cancel': 'NEIN NEIN NEIN' }
};
var InitialProps = {
i8 : stringTable,
var React = ...
var Editor = React.createClass({ ... });
var App = {
savedValue : 'Hello, World!',
currentValue : 'Hello, World!',
hot : false,
gulp.task('browserify', ['build', 'gc-copy'], function() {
var browserifyConfig = {
"entries" : [dirs.src + "/environment.js", dirs.built_js + "/global-components-ui.js"],
"extensions" : [".jsx"]
};
return browserify(browserifyConfig, { "debug" : !production })
// .transform({ "es6" : true }, reactify)
package com.j2n.sorting;
public class MyQuickSort {
private int array[];
private int length;
public void sort(int[] inputArr) {
if (inputArr == null || inputArr.length == 0) {
% straight calls are rewritten to internal signature
split_on(InList, Item) ->
split_on(InList, Item, [], []).
% if the work queue is empty, reverse the master list, append the
% reversed current list, and return
split_on([], _Item, WorkList, WorkMaster) ->
lists:reverse(WorkMaster) ++ lists:reverse(WorkList);
% if the current work item is the splitting item, reverse the work
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>React.js Hello World!</title>
<script defer src="https://fb.me/react-0.13.3.js"></script>
<script defer src="https://fb.me/JSXTransformer-0.13.3.js"></script>
<script defer type="text/jsx">
var example = [
'example 1a',
[
'example 2a',
[
[
'example 3'
]
]
'example 2b',