This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| var page = new WebPage(), | |
| address, output, size; | |
| //capture and captureSelector functions adapted from CasperJS - https://github.com/n1k0/casperjs | |
| capture = function(targetFile, clipRect) { | |
| var previousClipRect; | |
| var clipRect = {top: 0, left:0, width: 40, height: 40}; | |
| if (clipRect) { | |
| if (!isType(clipRect, "object")) { | |
| throw new Error("clipRect must be an Object instance."); |
This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.
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.
Sandi Metz :: @sandimetz
http://lever-rubynation.heroku.com/assets/fallback/index.html
Jeff Kunkle :: @kunklejr
http://kunklejr.github.com/nodejs-explained-pres
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |
| class ActiveRecord::Base | |
| mattr_accessor :shared_connection | |
| @@shared_connection = nil | |
| def self.connection | |
| @@shared_connection || ConnectionPool::Wrapper.new(:size => 1) { retrieve_connection } | |
| end | |
| end | |
| ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection |
| module StaticHelpers | |
| def action_for_template(template) | |
| File.basename(template).sub(/\.html\.haml$/, '') | |
| end | |
| end | |
| namespace :static do | |
| desc "Precompile static pages at public/*.html" | |
| task :precompile do | |
| include StaticHelpers |
| #! /bin/sh | |
| # | |
| # An OS X shell script to fix RMagick compilation issues when using Homebrew's | |
| # ImageMagick installation. This script creates the symlinks needed for | |
| # RMagick to compile. Quantum depths of 8 and 16-bits are supported. | |
| # | |
| # You can run this script with "sh whatever_script_name.sh" in your terminal | |
| # or with a click if you change the file extension to "command". | |
| # | |
| # You can manually make the links by visiting the ImagicMagick library |
| Go Rust | |
| ----------- ------ | |
| break break | |
| case (syntax) | |
| chan (library) | |
| const const | |
| continue loop | |
| default (syntax) | |
| defer | |
| else else |
| import sys | |
| import subprocess | |
| import tempfile | |
| import urllib | |
| text = sys.stdin.read() | |
| chart_url_template = ('http://chart.apis.google.com/chart?' | |
| 'cht=qr&chs=300x300&chl={data}&chld=H|0') | |
| chart_url = chart_url_template.format(data=urllib.quote(text)) |