Skip to content

Instantly share code, notes, and snippets.

wicz /
Created May 23, 2016 09:58 — forked from mislav/
Jim Weirich on the differences between procs and lambdas in Ruby

Jim Weirich:

This is how I explain it… Ruby has Procs and Lambdas. Procs are created with { }, lambdas are created with lambda {} and ->() {}.

In Ruby 1.8, proc {} creates lambda, and Ruby 1.9 it creates procs (don't ask).

Lambdas use method semantics when handling parameters, procs use assignment semantics when handling parameters.

This means lambdas, like methods, will raise an ArgumentError when called with fewer arguments than they were defined with. Procs will simply assign nil to variables for arguments that were not passed in.

wicz /
Created June 1, 2016 15:23 — forked from demisx/
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes


wicz /
Created July 5, 2016 13:27 — forked from chrisbolin/
Python SimpleHTTPServer for Static Serving (React / Angular / Ember) in HTML5 mode (a la mod_rewrite)
Taken from:
import SimpleHTTPServer, SocketServer
import urlparse, os
PORT = 3000
wicz /
Created April 9, 2013 13:28
Configuration files and scripts for the blog post: Faster Rails 3 deployments to AWS Elastic Beanstalk
#!/usr/bin/env bash
mkdir /var/app/ondeck/vendor /var/app/ondeck/public /var/app/support/bundle /var/app/support/assets /var/app/support/cache
ln -s /var/app/support/bundle /var/app/ondeck/vendor
ln -s /var/app/support/assets /var/app/ondeck/public
ln -s /var/app/support/cache /var/app/ondeck/vendor
sed -i 's/"rake/"bundle exec rake/' /opt/elasticbeanstalk/hooks/appdeploy/pre/
View haproxy.conf
maxconn 32
tune.ssl.default-dh-param 2048
mode http
option forwardfor
option http-server-close
timeout connect 2s