Skip to content

Instantly share code, notes, and snippets.

View minikomi's full-sized avatar
🍕
I like pizza

Adam Moore minikomi

🍕
I like pizza
View GitHub Profile
@schacon
schacon / gist:1
Created July 15, 2008 18:17
the meaning of gist
This is gist.
There are many like it, but this one is mine.
It is my life.
I must master it as I must master my life.
Without me gist is useless.
Without gist, I am useless.
# Code based on http://mikewest.org/2009/11/my-jekyll-fork
module Jekyll
module Filters
def to_month(input)
return Date::MONTHNAMES[input.to_i]
end
def to_month_abbr(input)
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@ezmobius
ezmobius / gist:807334
Created February 2, 2011 06:37
Run this script on a mac osx box running 10.6 and you will get a luajit with batteries included and all the good libs
#!/bin/bash
# have to hand install this one sorry http://www.cmake.org/files/v2.8/cmake-2.8.3-Darwin-universal.tar.gz
if [ "$1" == "cleanup" ]; then
echo "Cleaning up old luajit install"
cd /usr/local/share
sudo rm -rf lua luajit-2.0.0-beta6
@bnferguson
bnferguson / gist:887256
Created March 25, 2011 17:47
Daniel Shiffman's initial example in his PVector + Processing Tutorial re-written in clojure as an exercise.
; Daniel Shiffman's initial example in his PVector + Processing Tutorial
; re-written in clojure
(ns example1
(:use [rosado.processing]
[rosado.processing.applet]))
(set! *warn-on-reflection* true)
(defn bounced?
@hakank
hakank / gist:946920
Created April 28, 2011 18:15
Anagrams in a word list in K (Kona)
/
/ Here we explain a K function that shows all words in a word list
/ that are anagrams.
/
/
/ The K function used was found here:
/ http://lambda-the-ultimate.org/node/1323
/ Define the function
;; chrisvest's solution to http://4clojure.com/problem/53
(fn [xs] (or (->>
(map vector xs (range))
(partition-by #(apply - %))
(map #(map first %))
(filter #(> (count %) 1))
(sort-by (comp - count))
first) []))
@tj
tj / app.js
Created July 5, 2011 12:52
express auto-generated rest client
var express = require('express')
, client = require('../')
, app = express.createServer();
var users = [
{ name: 'tobi' }
, { name: 'loki' }
, { name: 'jane' }
, { name: 'manny' }
@yevgenko
yevgenko / .Xdefaults
Created August 24, 2011 02:58
URxvt settings with solarized theme
!-------------------------------------------------------------------------------
! Xft settings
!-------------------------------------------------------------------------------
Xft.dpi: 96
Xft.antialias: false
Xft.rgba: rgb
Xft.hinting: true
Xft.hintstyle: hintslight
@valpackett
valpackett / dijkstra.clj
Created August 27, 2011 16:28
Dijkstra's algorithm in Clojure
; http://www.algolist.com/Dijkstra's_algorithm
(defn dijkstra [g src]
(loop [dsts (assoc (zipmap (keys g) (repeat nil)) src 0)
curr src
unvi (apply hash-set (keys g))]
(if (empty? unvi)
dsts
(let [unvi (disj unvi curr)
nextn (first (sort-by #(% dsts) unvi))