Skip to content

Instantly share code, notes, and snippets.

View itsbth's full-sized avatar

Bjørn Tore Håvie itsbth

View GitHub Profile
SEXP (display "Hello, World!")
Hello, World!
SEXP (def greet (lambda (who) (cat "Hello, " who "!")))
SEXP (display (greet "Martiny"))
Hello, Martiny!
SEXP (display "a")
a
SEXP (display "b")
b
SEXP ()
SEXP (display "Hello, World!")
Hello, World!
SEXP (def greet (lambda (who) (cat "Hello, " who "!")))
SEXP (display (greet "Martiny"))
Hello, Martiny!
SEXP (display "a")
a
SEXP (display "b")
b
SEXP ()
local function parse(str, pos)
local read, readchar, readcharws, peekchar, eof
pos = pos or 1
local readtable = {
['^"'] = function()
local escape = {
['\\'] = '\\',
['"'] = '"'
}
local out = {}
local function parse(str)
local read, readchar, readcharws, peekchar, eof
local pos = 1
local readtable = {
['^"'] = function()
local escape = {
['\\'] = '\\',
['"'] = '"'
}
local out = {}
local function parse(str)
local read, readchar, readcharws, peekchar, eof
local pos = 1
local readtable = {
['^"'] = function()
local escape = {
['\\'] = '\\',
['"'] = '"'
}
local out = {}
predicate! Fizzy(n) = n mod 3 == 0
predicate! Buzzy(n) = n mod 5 == 0
print 1..100 each match ->
Fizzy? and Buzzy? -> "FizzBuzz"
Fizzy? -> "Fizz"
Buzzy? -> "Buzz"
n -> n
import sys
import subprocess
import imp
from os import path
class CppFinder(object):
def find_module(self, fullname, ignored=None):
print("find_module(self, {}, {})".format(fullname, path))
if path.exists(fullname + ".cpp"):
@itsbth
itsbth / -
Created February 25, 2015 23:42
Hello, World
find_module(self, foo, <module 'posixpath' from '/usr/lib/python3.4/posixpath.py'>)
load_module(self, foo)
@itsbth
itsbth / -
Created February 25, 2015 23:41
import loader
loader.register()
import foo
foo.run()
#include <cstdio>
int main() { std::printf("Hello, World\n"); }
Hello, World
find_module(self, foo, <module 'posixpath' from '/usr/lib/python3.4/posixpath.py'>)
load_module(self, foo)
@itsbth
itsbth / test.ps
Last active August 29, 2015 14:15
%!PS-Adobe-2.0
%%Creator: dvips(k) 5.993 Copyright 2013 Radical Eye Software
%%Title: test.dvi
%%CreationDate: Wed Feb 18 00:38:12 2015
%%Pages: 1
%%PageOrder: Ascend
%%BoundingBox: 0 0 596 842
%%DocumentFonts: CMR17 CMR12
%%DocumentPaperSizes: a4
%%EndComments