Skip to content

Instantly share code, notes, and snippets.

...and it was good.

Delon Newman delonnewman

Block or report user

Report or block delonnewman

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View define.rb
class Var
attr_reader :meta, :namespace, :name
def self.intern(namespace, name, init = nil)
@@vars ||= {}
@@vars[name] = begin
v =, namespace, name)
v.set(init) if init
delonnewman / day1.js
Last active Aug 10, 2018
An Introduction to Abstraction with Functions
View day1.js
function square(x) {
return x * x;
function area(r) {
return Math.PI * square(r);
function add1(x) {
return 1 + x;
View comments.xml
This also works
or this -->
<!-- and this too!
AUTH='OAuth oauth_consumer_key="0MR6AA46EH0FRSCHVIR0PH9KKX8",oauth_nonce="sMhmFlY",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1521044097729",oauth_version="1.0a",oauth_signature="f3z97KFOYnIRkNHzQc%2B0Qv%2FQdsI%3D"'
curl -XPOST -H "Content-type: $CONTENT_TYPE" -H "Authorization: $AUTH" --data "[]" "$API_URI/$ENDPOINT"
View .vimrc
" General
set nocompatible
filetype on
filetype plugin on
filetype indent plugin on
set ofu=syntaxcomplete#Complete
set modeline
set history=1000
set clipboard+=unnamed
set ffs=unix,dos,mac
delonnewman / run.php
Created Apr 29, 2017 — forked from greut/run.php
A web server in pure PHP (non-concurrent and concurrent)
View run.php
#!/usr/bin/env php
$app = function($request) {
$body = <<<EOS
<!DOCTYPE html>
<meta charset=utf-8>
<title>Hello World!</title>
View escape_mb_chars.php
function escape_mb_chars($str) {
$first = preg_replace_callback('/\p{C}/u', function ($m) {
$char = current($m);
return substr(json_encode($char), 1, -1);
}, $str);
return rtrim($first, '\n');
delonnewman / diff.clj
Created Aug 9, 2016
Joseph McCarthy's diff function in WonderScript
View diff.clj
; vim: set ft=clojure
; Joseph McCarthy's diff function
; see:
; J. McCarthy, Recursive Functions of Symbolic Expressions and Their Computation by Machine, Part I, April 1960
; diff [y; x] = [atom[y] →
; [eq[y; x] → ONE; T → ZERO];
; eq[car [Y]; PLUS] → cons [PLUS; maplist[cdr[y]; λ[[z]; diff[car [z]; x]]]];
; eq[car [y]; TIMES] → cons[PLUS; maplist[cdr[y];
; λ[[z]; cons [TIMES; maplist[cdr [y];
function _common_section
printf $c1
printf $argv[1]
printf $c0
printf ":"
printf $c2
printf $argv[2]
printf $argv[3]
printf $c0
printf ", "
View dbval.clj
; from
(let [dbval (d/db conn)]
(->> (d/q '[:find ?ident
:in $ ?p
[:db.part/db :db.install/attribute ?attr]
[?attr :db/ident ?ident]]
dbval :db.part/user)
(map (fn [attr] [(d/entity dbval (first attr))]))
(map (fn [attr]
You can’t perform that action at this time.