Skip to content

Instantly share code, notes, and snippets.

View jonsterling's full-sized avatar

Jon Sterling jonsterling

View GitHub Profile
import Prelude
import Control.Applicative
-- These are some sketchy implementations of integral approximations.
-- They work, but are probably in need of refactoring.
-- I repeat: I SUCK at Haskell, so this is really gross.
midApp n a b f = h * (foldl (+) 0 vals) where
h = (b - a)/n
vals = [midF i | i <- [1..n]] where
\usepackage{ifthen,delarray}
\newcommand{\phonarr}[1]{
\ifthenelse{\equal{#1}{}}{}{\ensuremath{
\begin{array}[c][ {l} ]
#1
\end{array}
}}
}
\newcommand{\genmap}[2]{#1\ $\to$\ #2}
@jonsterling
jonsterling / Volk-Text-16.mdown
Created October 12, 2010 06:02
Sumerian Translation

Just transcribed (out of cuneiform) and translated this monster passage:

e2-an-na-tum2 ensi2 lagaški a2-šum2-ma en-lil2-ke4 ga-zi ni-gu7-a dnin-hur-saǧ-ke4 mu-pad3-a2 dnin-ǧir2-su2-ke4 ša3-pad3-a2 dnanše-ke4 dumu-a-kur-gal ensi2 lagaški kur elamki aga3-kar2 bi-se3 URUxAki aga3-kar2 bi-se3 ummaki aga3-kar2 bi-se3 uri5ki aga3-kar bi-se3 ud ba dnin-gir2-su2-ra kisal-daǧal-la-na pu2-sig4-bahar2-ra mu-na-ni-du3 diǧir-ra-ni dšul-utul12 ud-ba dnin-ǧi

\usepackage{covington}
%....
\begin{examples}
\item[(o)] \gll no-nintsi-mi eeroka naaka
1st.\textsc{subj}.like.2nd.\textsc{obj} I you
\glt `I like you.'
\glend
\item[(a)] \gll no-yaatsi naaka
1st.\textsc{subj}.go I
struct arr : obj
{
arr(id *input)
{
size_t s = sizeof(input) - 1;
this->substrate_object = [NSArray arrayWithObjects:input count:s];
}
arr(NSArray *input) : obj::obj(input) {}
@jonsterling
jonsterling / gist:736656
Created December 10, 2010 19:21
code snippets for JSBag post
+ (id)bagWithCollection:(id <NSFastEnumeration>)enumerable;
@jonsterling
jonsterling / gist:762382
Created January 2, 2011 07:33
Foam-Lang Samples

My tiny language, Foam, is coming along nicely! The following code:

tv := @textView
as := tv typingAttributes. mutableCopy
as setObject:@defaultParagraphStyle forKey:NSParagraphStyleAttributeName
@defaultTypingAttributes = as

tv setTypingAttributes:@defaultTypingAttributes
tv setDefaultParagraphStyle:@defaultParagraphStyle
Description Debit Credit
----------------------------------------------------
Accounts Receivable / JT Bandes 100.00
Revenue / Accounting Help 10.00
Revenue / Other Services 90.00
Depreciation Expense 4000.00
Accumulated Depreciation / Equip. 4000.00
----------------------------------------------------
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.0.320 (May 03 2009)
*
//
// BubbleView.h
//
// Created by Josh Kendall on 12/28/10.
// Copyright 2010 JoshuaKendall.com. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>