Skip to content

Instantly share code, notes, and snippets.

@jafstar
jafstar / cbook.txt
Created June 10, 2012 23:42
Computer Science: A Structured Programming Approach Using C (2nd Edition)
Book:
Computer Science: A Structured Programming Approach Using C (2nd Edition)
Amazon:
http://www.amazon.com/gp/product/0534374824/ref=ox_sc_act_title_1?ie=UTF8&m=A26J6JNN8TGTL9
Class:
http://www.postech.ac.kr/class/cs101/html/index.html
Lectures:
@ckirkendall
ckirkendall / clojure-match.clj
Created June 15, 2012 02:26 — forked from bkyrlach/Expression.fs
Language Compare F#, Ocaml, Scala, Clojure, Ruby and Haskell - Simple AST example
(use '[clojure.core.match :only [match]])
(defn evaluate [env [sym x y]]
(match [sym]
['Number] x
['Add] (+ (evaluate env x) (evaluate env y))
['Multiply] (* (evaluate env x) (evaluate env y))
['Variable] (env x)))
(def environment {"a" 3, "b" 4, "c" 5})
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 10, 2024 21:24
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@wmorgan
wmorgan / gist:3054620
Created July 5, 2012 16:18
Mustache templating for Clojure
(ns potato.core
(:use [slingshot.slingshot :only [throw+ try+]])
(:use [clojure.string :only [trim split]]))
;; use this provide template values at write time (i.e. not compile time).
;; "name" will be the name of the template variable. "context", when not nil,
;; will be the value previously returned by *template-value* for the enclosing
;; section.
(defn ^:dynamic *template-value* [name context])
with(x, {
f(z)
})
# Which of the following statements is this equivalent to?
#
# a) x$f(x$z)
# b) f(x$z)
# c) x$f(z)
# d) f(z)
@evildmp
evildmp / gist:3094281
Last active June 30, 2023 10:55
Set up Django, nginx and uwsgi

This document has now been incorporated into the uWSGI documentation:

http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html

Set up Django, nginx and uwsgi

Steps with explanations to set up a server using:

@xsawyerx
xsawyerx / datetime.pl
Created July 13, 2012 20:38
Finding Friday the 13th
use strict;
use warnings;
use DateTime;
my $dt = DateTime->new(
day => 13,
year => 2012,
);
my $count = 0;
@psychemedia
psychemedia / rchitecture.dot
Created July 15, 2012 21:46
An Rchitecture for Reproducible Data Journalism
digraph G {
subgraph cluster_1 {
Rscript -> localDir;
localDir -> Rscript;
Rscript -> Sweave;
Sweave -> TeX;
TeX -> PDF [ label = "laTeX"]
Rscript -> Rmarkdown;
RCurl -> Rscript;
@moritz
moritz / sqrt.p6
Created August 3, 2012 02:56
compute 10k'th digit of sqrt(2) in Perl 6
my Int $i = 2 * 10 ** 20_002;
my Int $sqrt = 10 ** 10_001;
my Int $next_sqrt = ($i div $sqrt + $sqrt) div 2;
loop {
$sqrt = $next_sqrt;
$next_sqrt = ($i div $sqrt + $sqrt) div 2;
last if $sqrt == $next_sqrt;
}
@jeffreykegler
jeffreykegler / round2_EASY.pl
Created August 7, 2012 01:37
Marpa v. Perl regex, round 2 (EASY)
#!perl
use 5.010;
use strict;
use warnings;
use autodie;
use Benchmark qw(timethis);
use List::Util qw(min);
use Regexp::Common qw /balanced/;