Skip to content

Instantly share code, notes, and snippets.

View duktape.ooo.diff
diff -Naur duktape/src-input/builtins.yaml duktape-ooo/src-input/builtins.yaml
--- duktape/src-input/builtins.yaml 2019-05-11 19:06:14.000000000 -0700
+++ duktape-ooo/src-input/builtins.yaml 2019-05-04 18:07:33.000000000 -0700
@@ -204,80 +204,80 @@
# This could be stripped when DUK_USE_GLOBAL_BUILTIN is disabled
# ("void 0" is the same and safer) but it's commonly used so keep.
- - key: "Object"
+ - key: "OOOObjectOOO"
value:
View server.py
import sys
import time
import nclib
r = nclib.Netcat(listen=("localhost", 9090))
while not r.closed:
line = r.recv_line()
r.send(line)
@adamdoupe
adamdoupe / for_all_in_path.py
Created Sep 1, 2013
Function that abstracts the access pattern of os.makedirs (run this function on every directory in this directory structure).
View for_all_in_path.py
from os import path
def for_all_in_path (name, fun):
"""
Iterator to run the given function (fun) on each directory in the given path (name).
Example: for_all_in_path("test/adam/example", fun) would call:
fun("test")
fun("test/adam")
fun("test/adam/example")
View sshere
function sshere {
CURRENT=$(pwd)
[[ "$CURRENT" =~ ^"$HOME"(/|$) ]] && CURRENT="~${CURRENT#$HOME}"
ssh -t $@ "if [ -d $CURRENT ]; then cd $CURRENT; fi; exec \$SHELL"
}
@adamdoupe
adamdoupe / ast.scala
Created Oct 24, 2012
Generating AST for CS260 F12
View ast.scala
import org.scalacheck._
import org.scalacheck.Prop._
import pllab.lwnn._
import pllab.lwnn.syntax._
object AbstractStateSpecification extends Properties("States") {
import Prop.forAll
import Gen._
import Arbitrary.arbitrary