Skip to content

Instantly share code, notes, and snippets.

View afeld's full-sized avatar

Aidan Feldman afeld

View GitHub Profile
@bkeepers
bkeepers / twithubbers.sh
Created June 4, 2013 14:29
Create a list of GitHubbers and follow all of them.
#!/bin/sh
#
# Requires the `t` gem: https://github.com/sferik/t
#
# gem install t
#
if [ -z $(t lists | grep -i githubbers) ]
then
t list create GitHubbers
@churchofthought
churchofthought / gist:5202041
Last active October 23, 2017 13:25 — forked from anonymous/gist:5202029
Y Combinator Explained
I just finally had my mind snap into place with understanding of the Y Combinator. Most explanations I read, even the ones using JS, didn't make much sense and were overly long so here follows my own, much simpler explanation. I will be using JS.
We have fibonacci to start with, very simple recursive function.
It's fixed points are 0 and 1, fib(0) = 0, and fib(1) = 1
That's all a fix point means, when the f(x) == x
They are important because they are the only values at which recursion can cease.
Our Fibonacci Function
======================
anonymous
anonymous / gist:5202029
Created March 20, 2013 03:15
Y Combinator Explained
Going to use JS to explain.
We have fibonacci to start with, very simple recursive function.
It's fixed points are 0 and 1, fib(0) = 0, and fib(1) = 1
That's all a fix point means, when the f(x) == x
They are important because they are the only values at which recursion can cease.
Our Fibonacci Function
======================
function fib(x){
return x + (x > 0 ? fib(x-1) : 0)
@willglynn
willglynn / -- results.txt
Last active December 10, 2015 22:08
Experiments with Jux stylesheets
# I split up jux.desktop-c2366d6aa995c5fe80506debabee8ee2.css into parts:
# - one file for .theme-day
# - one file for .theme-dusk
# - one file for everything else
#
# My thought was that Jux.com could load the relevant theme CSS, and unload
# the unused theme(s). This would result in significantly fewer active CSS
# rules and some savings of data transfer without requiring much in terms of
# code changes.
#
@lecram
lecram / escher.py
Last active February 12, 2025 16:49
This is a toy one-file application to manage persistent key-value string data. The file is *both* the application and its data. When you run any of the commands described in `escher.py --help`, the file will be executed and, after data change, it will rewrite itself with updated data. You can copy the file with whatever name to create multiple d…
#! /usr/bin/env python
"""{escher} -- one-file key-value storage.
What?
This is a toy application to manage persistent key-value string data.
The file {escher} is *both* the application and its data.
When you run any of the commands below, the file will be executed and,
after data change, it will rewrite itself with updated data.
You can copy the file with whatever name to create multiple datasets.
@domenic
domenic / promises.md
Last active April 1, 2025 01:54
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
@juliocesar
juliocesar / Rakefile
Created August 10, 2012 02:06
Poor man's dev suite
task :run do
rackup = Thread.start { `rackup -p 4567` }
compass = Thread.start { `compass watch --sass-dir sass --css-dir css` }
# ...
at_exit { Thread.kill(rackup) and Thread.kill(compass) }
sleep
end
# In the console, just run:
# $ rake run
@davidjrice
davidjrice / redcarpet.rb
Created June 29, 2012 00:34
Rails 3.2 Markdown Template Handler
# config/initializers/redcarpet.rb
module ActionView
module Template::Handlers
class Markdown
class_attribute :default_format
self.default_format = Mime::HTML
def call(template)
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :autolink => true, :space_after_headers => true)
markdown.render(template.source).html_safe.inspect
@isaacs
isaacs / .gitconfig
Created June 8, 2012 19:01
These are my shortcuts for git.
# A bunch of the stuff above relies on this, especially the aliases.
[user]
# you probably want to change this bit.
name = isaacs
email = [email protected]
signingkey = 0x6C481CF6
[alias]
ci = commit
st = status
br = branch
@joerichsen
joerichsen / parallel_assets_compiler.gemspec
Created June 5, 2012 06:23
Microgem for compiling assets in parallel
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = 'parallel_assets_compiler'
s.version = '0.2.0'
s.platform = Gem::Platform::RUBY
s.author = 'Jørgen Orehøj Erichsen'
s.email = '[email protected]'
s.summary = 'Compile assets in parallel'
s.description = 'Compile assets in parallel to speed up deployment'