Skip to content

Instantly share code, notes, and snippets.

Jeanine Adkisson jneen

Block or report user

Report or block jneen

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 hilite.sty
\makeatletter
\newwrite\shellout@out
\def\shellout@writeout@start#1{%
\begingroup
\immediate\openout\shellout@out#1%
\let\do\@makeother\dospecials%
\catcode`\^^M\active%
\def\verbatim@processline{%
\immediate\write\shellout@out{\the\verbatim@line}}%
View thankful-eyes-theme.el
(deftheme thankful-eyes "a port of the thankful eyes theme from gtksourceview")
(let ((class '((class color) (min-colors 89)))
(cool-as-ice (if (display-graphic-p) "#6c8b9f" "#6c8b9f"))
(slate-blue (if (display-graphic-p) "#4e5d62" "#4e5d62"))
(eggshell-cloud (if (display-graphic-p) "#dee5e7" "#dee5e7"))
(krasna (if (display-graphic-p) "#122B36" "#121212"))
(aluminium1 (if (display-graphic-p) "#fefeec" "#fefeec"))
(scarletred2 (if (display-graphic-p) "#cc0000" "#cc0000"))
View blanking.sh
#!/bin/bash
blanking() {
local mode="$1"; shift
case "$mode" in
-|stop) xset -dpms; xset s off ;;
+|start) xset +dpms; xset s on ;;
sus|suspend)
wake-loop &
ensure kill $!
View elron.ml
open Batteries.Printf
open Batteries
type 't tokstate = Start | Tok of 't | Err of string | Eof
type 't state = {
mutable index : int ;
mutable head : 't tokstate ;
mutable behind : 't tokstate list ;
mutable ahead : 't tokstate list ;
View dynamic.js
var Dynamic = function() {
var context = {}
var defaults = {}
function bind(name, val, fn) {
try {
var save = context[name];
context[name] = val;
var out = fn();
}
View testy.sh
#!/bin/bash
echo == example the first ==
f1() {
local v=1
echo f1: $v
f2
}
View frybo.clj
(defn frybo [fname]
(def raf (java.io.RandomAccessFile. fname "r"))
(def out-chan (chan 10))
(go-loop [] (>!! out-chan (.readByte raf)))
out-chan)
@jneen
jneen / order.md
Created Jun 16, 2015
Tulip evaluation order (DRAFT)
View order.md

In tulip, a function call is expressed as a sequence of expressions, with parentheses appearing freely:

f arg1 (arg2) (g arg3)

If a function receives fewer arguments than its arity, the result is a curried function expecting the remaining arguments. If it receives more, it consumes its arity and calls the return value with the rest. The order of evaluation for a function call is:

  • The function expression is evaluated
  • Each argument is evaluated
View viewer.rb
#!/usr/bin/env ruby
require 'gtk3'
fname = ARGV[0]
def window(&b)
w = Gtk::Window.new
proc { w.instance_eval(&b) }
end
View cases.rb
module Kernel
def cases(o, cases={})
o = [o] unless o.is_a? Array
raise "invalid" unless o[0].is_a? Keyword
selection = cases[o[0]] || cases[:else] || raise("non-exhaustive cases!")
selection.call(*cases[1..-1])
end
end
You can’t perform that action at this time.