Skip to content

Instantly share code, notes, and snippets.

View aculich's full-sized avatar
😀
Having fun exploring repos for Computational Text Analysis with D-Lab CTAWG

Aaron Culich aculich

😀
Having fun exploring repos for Computational Text Analysis with D-Lab CTAWG
View GitHub Profile
@defunkt
defunkt / installing-mustache-mode.el.md
Created March 6, 2010 10:11
Installing mustache-mode.el

https://github.com/mustache/emacs

In your shell:

cd ~/.emacs.d/vendor
curl -O https://github.com/mustache/emacs/raw/master/mustache-mode.el

In your Emacs config:

(add-to-list 'load-path "~/.emacs.d/vendor/mustache-mode.el")

#include <iostream>
#include <type_traits>
#include <string>
// primality test
template<int N, int M>
struct divides
{
enum { value = ((N%M) == 0) || divides<N, M-1>::value };
@defunkt
defunkt / gist:449668
Created June 23, 2010 08:55 — forked from dustin/gist:397971
Emacs Lisp to automatically add, commit, and push when files change
;; Automatically add, commit, and push when files change.
(defvar autocommit-dir-set '()
"Set of directories for which there is a pending timer job")
(defun autocommit-schedule-commit (dn)
"Schedule an autocommit (and push) if one is not already scheduled for the given dir."
(if (null (member dn autocommit-dir-set))
(progn
(run-with-idle-timer
@takumikinjo
takumikinjo / .gitignore
Created August 5, 2010 13:56
HTML5 Presentation export for Org-mode
README.html
@laughinghan
laughinghan / schedule.php
Created August 25, 2010 16:01
Better Schedule Search for Berkeley
<?php
/*
* schedule.php
*
*
* Created by Jay on 12/4/09, based on Han's Better Schedule Search.
* Gift-Economy license. See en.wikipedia.org/wiki/Gift_economy
*
*/
import Prelude hiding (head)
import Data.Enumerator
import Control.Monad.IO.Class
sum1 :: [Int] -> Int
sum1 [] = 0
sum1 (x:xs) = x + sum xs
getNumber :: IO (Maybe Int)
getNumber = do
@mblondel
mblondel / perceptron.py
Last active April 21, 2024 13:42
Kernel Perceptron
# Mathieu Blondel, October 2010
# License: BSD 3 clause
import numpy as np
from numpy import linalg
def linear_kernel(x1, x2):
return np.dot(x1, x2)
def polynomial_kernel(x, y, p=3):
@davemo
davemo / app.js
Created May 3, 2011 21:43
A way to add declarative bindings using jQuery and a simple module pattern.
// Given a simplified module pattern like so:
(function(APP, $, _) {
APP.MyWidget = function(opts) {
var self = {};
var defaults = {
// an array of contexts and declarative event bindings
bindings : [
{
@krgn
krgn / gist:972202
Created May 14, 2011 13:18
ant and android - macro to kill, uninstall, install and then launch an app. requires a simple setting of "main-activity" in projects build.xml
<macrodef name="install-helper">
<sequential>
<echo>Killing the running app...</echo>
<exec executable="${adb}" failonerror="true">
<arg line="${adb.device.arg}" />
<arg value="shell" />
<arg value="killall" />
<arg value="${manifest.package}" />
</exec>
<echo>Uninstalling previous version for clean slate...</echo>
@ivant
ivant / Makefile
Created July 10, 2011 05:12
wc using Data.Enumerator
.PHONY: all clean test
DATA_REPEATS?=1000
DATA_FILE?=/usr/share/dict/words
GHC_OPTS?=-fspec-constr-count=64 -funfolding-use-threshold=64
all: wce wci
clean:
rm -f wce wci *.hi *.o