Skip to content

Instantly share code, notes, and snippets.

View buntine's full-sized avatar
💭
Gringo Starr

Andrew Buntine buntine

💭
Gringo Starr
View GitHub Profile
;;; Calculates all elements of Pascal's Triangle up to a particular width/row.
(define (pascal width)
(reverse (pascal-helper '((1)) width)))
(define (pascal-helper rows width)
(if (= (length rows) width)
rows
(pascal-helper (cons (next-row (car rows))
rows)
; This function returns a closure. That is, the returned anonymous function
; saves a reference to the free variable "n".
(defn make-adder [n]
"Returns a function that sums a given value (m) with n."
(fn [m]
(+ n m)))
(def add-10 (make-adder 10))
; When we invoke the function, rather than creating a new environment, it will
; letfn is a Clojure macro that allows for mutually recursive functions.
; In some lisps, letfn (or letrec) will expand to a lambda expression.
(letfn [(fact-helper [total n]
(if (<= n 1)
total
(fact-helper (* n total) (- n 1))))]
(defn fact [n]
(fact-helper 1 n)))
(fact 5) ; 120
@buntine
buntine / cfcc-1.scm
Created December 12, 2010 06:47
Snippets for blog article on continuations
(lambda (n) (+ n 1))
//Selecting Item Colours
$(".dress-container .select-colour a").click(function(){
//find the colour range
var colourRange = $(this).parent().next(".colours");
//find the links in the colour range
var colourRangeLink = $(colourRange).find("a");
//showing colour range
$(colourRange).show();
- AGMEN - Damnation - LP - Breath of Night - 99
- ALARM - Rock'n'Roll v patách - LP - Monitor - 90
- ALKEHOL - Alkehol - LP - Monitor - 92
- ALKEHOL - S Úsměvem Se Pije Líp - LP - Monitor - 93
- AMON - Call the Master! - LP - Doomentia - 10
- ANACHRONIC - Lame Gart And... - LP - BestIA - 93
- APOLON - TVÁR SEBCA / ČACHTICKÁ PANI - 7” - Zeras - 92
- ARAKAIN - Black Jack - LP - Monitor - 92
- ARAKAIN - Excalibur / Gladiátor - 7" - Panton - 88
- ARAKAIN - Ku-Klux-Klan / Orion - 7" - Supraphon - 89
class TestsController < ApplicationController
def index
@callback_url = "http://127.0.0.1:3000/tests/callback"
@consumer = OAuth::Consumer.new("YOUR_APP_KEY","YOUR_APP_SECRET", :authorize_url => "http://www.discogs.com/oauth/authorize", :site => "http://api.discogs.com")
@request_token = @consumer.get_request_token(:oauth_callback => @callback_url)
session[:request_token] = @request_token
redirect_to @request_token.authorize_url(:oauth_callback => @callback_url)
@buntine
buntine / deploy.rb
Created July 14, 2014 01:36
Rails 4, Capistrano 3.2.1+ local precompilation using rsync
# Clear existing task so we can replace it rather than "add" to it.
Rake::Task["deploy:compile_assets"].clear
desc "Precompile assets locally and then rsync to web servers"
task :compile_assets do
on roles(:web) do
rsync_host = host.to_s
run_locally do
with rails_env: :production do ## Set your env accordingly.
from Tkinter import *
import tkFont
import subprocess, os, re
BASE = "/home/andrew/Downloads/SNES/ROMS/"
def play(e):
lb = e.widget
text = lb.get(ACTIVE)
filename = lb.data[text]
---
- aclit
- adick
- aids
- alabama porch monkey
- anal intruder
- anal invader
- analicker
- anus
- "4r5e"