Programs should be written in the second-person.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Still run as sudo | |
var fs = require("fs"); | |
var path = require("path"); | |
var defaultFormats = []; | |
defaultFormats.push(/^(.+) (.+):([A-Fa-f0-9]+)->(.+) ([0-9]{0,3}\.[0-9]{0,3}\.[0-9]{0,3}\.[0-9]{0,3}) #([0-9-]+) 1 1$/); | |
defaultFormats.push(/^(.+):(.+)::(([A-Za-z0-9_]|\.|\/|\$)+)$/); | |
defaultFormats.push(/^(.+):(.+):([0-9]{0,3}\.[0-9]{0,3}\.[0-9]{0,3}\.[0-9]{0,3}):(([A-Za-z0-9_]|\.|\/|\$)+)$/gm); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foo(stream) { | |
if (stream.lookahead("if")) { | |
var ifNode = stream.consume("if"); | |
var elseIfNode = stream.maybe("else if") || stream.maybe("poop") | |
} | |
} | |
var dot = (str) => str.consume("."); | |
var minus = (str) => str.consume("-"); | |
var parseIf = (str) => str.consume("if"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use <filter> as only | |
use <func> as F | |
use [Input] of <io> | |
fn fib(n) { | |
ret F.decide({ | |
n <= 1 : () => n | |
}).else(() => F.sum([ | |
fib(n - 1), | |
fib(n - 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grammar Grammar; | |
WS: [ \n\r\t] -> skip; | |
ID: [A-Za-z_] [A-Za-z0-9_]*; | |
compilationUnit: block*; | |
block: name=ID '{' (stmt ';'*)* '}'; | |
stmt: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mode release { | |
# Define executables | |
assembler "i686-elf-as" | |
compiler "i686-elf-gcc" | |
bootstrap "boot.s" | |
link "linker.ld" | |
sources "src/**/*.c", "path.c" | |
entry "kernel.c" | |
grub "menu.grub" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@component() | |
export default class Layout { | |
render() { | |
return div { | |
this.title(), | |
this.content() | |
}; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function add2(num) { | |
return num + 2; | |
} | |
function add2_array(num[]) { | |
return num.map(function(num) { | |
return add2(num); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:angel_framework/angel_framework.dart'; | |
import 'package:angular2/angular2.dart'; | |
import 'playing_card.dart'; | |
import 'lib/models/user.dart'; | |
@Component( | |
selector: 'home', | |
templateUrl: 'home.html', | |
directives: const [PlayingCardComponent]) | |
class HomeComponent { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Auto-Follow Twitter Users | |
// @namespace https://gist.github.com/thosakwe/6f9fb4c3b7df5bac20c552781409dd41 | |
// @version 1.0 | |
// @description Press CTRL+SHIFT+Y/⌘+SHIFT+Y to click every 'Follow' button on the current Twitter page. | |
// @author thosakwe | |
// @match https://*.twitter.com/* | |
// @require https://code.jquery.com/jquery-3.1.1.slim.min.js | |
// @require https://cdnjs.cloudflare.com/ajax/libs/mousetrap/1.6.0/mousetrap.min.js | |
// @grant none |