Skip to content

Instantly share code, notes, and snippets.

View banister's full-sized avatar
🇳🇱

John Mair banister

🇳🇱
View GitHub Profile
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 4, 2024 21:33
A badass list of frontend development resources I collected over time.
@gaearon
gaearon / slim-redux.js
Last active April 25, 2024 18:19
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
@burke
burke / 0-readme.md
Created January 27, 2012 13:44 — forked from funny-falcon/cumulative_performance.patch
ruby-1.9.3-p327 cumulative performance patch for rbenv

ruby-1.9.3-p327 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.

Requirements

You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.

@datenimperator
datenimperator / Gemfile
Created September 7, 2012 18:55
Sinatra, sprockets, compass, bootstrap-sass playing together
source :rubygems
gem 'shotgun', :group=>:development
gem 'rack-cache'
gem 'sinatra', :require => 'sinatra/base'
gem 'sinatra-support'
gem 'haml'
@MyArtChannel
MyArtChannel / development.rb
Created April 25, 2011 20:42
Use Pry as IRB replacement in rails 3 console
# Add this to the end of your development.rb and add
#
# gem 'pry'
#
# to your Gemfile and run bundle to install.
silence_warnings do
begin
require 'pry'
IRB = Pry
jViTBizGANaGywdZaYavwXUBWBuf5qQJVFVBQP6iaURq9veP87jsEBxCwX2ouY10
cWFL2RxOhWhKIkAj6aS8ZTVwliKBeTA2Mwb51mCfsXbUoupWGkmdtTyyVN0i
GQz2naCg+OGmAo8gysw1bIXKvqdTkIqrM1/ybBAKhD1EMFJhalChIYCv8PpD
uS8EFby+z5bTKJ6v/JXmORIylGZeAWLdF1LXGePx8xQCQA8/PlC8qAQJxf0vs0
iK2y2JAtSvcBwB9KGuNjOJ/IFsCSvnpQ92tM/t2vMnTQ9EUyGbse5Dhj7dgL
SCIK2E4RbSa5KFgIGyxBxQV4Y91/gmAE6Cf9WQ4Zo35E6oFQSIH73Xt5TxDouY
1n4yZGbf0Uu5/q5zkkcIV3Hb5UNs8or6iGylnRDiY3PBGSCPnP85roGD7DNp
ssrRXVq0+hgCdxSwN7j3zyTm9vAQ3A9xI0Re7PBXZ8ecXfWqXB1ph9b8oCKS6
tBlyTdFDGlbKcP/6yStHr/zWWDM1pgVr9uEPFBIVz/d+7KCe0oifb6B+8jGd
CTW5VzbtMyw6hImkDROwJ9BmVAjboUutMG0koI_31HKBRaaaaaaaaCmDwSGrQLRw
# I want this method in ruby-core
def let
yield
end
def fib(i)
let do |n = 1, result = 0|
if i == -1
result
else
@banister
banister / gist:1289619
Created October 15, 2011 14:11
using LD_PRELOAD to override functions like rb_raise() in ruby with my own definitions in an .so
If you set LD_PRELOAD to the path of a shared object, that file will be loaded before any other library (including the C runtime, libc.so). So to run ls with a your special malloc() implementation, do this:
$ LD_PRELOAD=/path/to/my/malloc.so /bin/ls
alias.unstage=reset HEAD --
alias.br=branch
alias.co=checkout
alias.ci=commit
alias.last=log -1 -p HEAD
alias.fi=diff --name-only
alias.di=diff
alias.st=status -s --untracked=no
alias.dc=diff --cached
alias.rmc=rm --cached
%%% Monad.oz --- A synax that resembles Haskell's do notation for monads.
%% NB: The macros need to be evaluated before the examples can be run
declare Maybe Reader State Seq in
fun {Seq Monad A B}
{Monad.bind A fun {$ _} B end}
end
%% Syntax: return X