This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'action_dispatch/middleware/stack' | |
| class BaseMiddleware | |
| def initialize(stack) | |
| @stack = stack | |
| end | |
| def call(data) | |
| processed = process(data) | |
| @stack.call(processed) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Tile() { | |
| let origin = 0b00000000; | |
| let weightBitMask = 0b1111; | |
| let colorBitMask = 0b11; | |
| let typeBitMask = 0b11; | |
| this.setType = function(value) { | |
| value &= typeBitMask; | |
| origin &= ~typeBitMask; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'active_support/callbacks' | |
| class Example | |
| include ActiveSupport::Callbacks | |
| define_callbacks :action | |
| def do | |
| run_callbacks :action do | |
| puts "Run :action callback!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Latency Comparison Numbers | |
| -------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns | |
| Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms | |
| Read 4K randomly from SSD* 150,000 ns 0.15 ms |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo /Developer/Library/uninstall-devtools -mode=all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Install libxml2 using Homebrew | |
| # If you don't have Homebrew, follow the instructions at: | |
| # https://github.com/mxcl/homebrew/wiki/Installation | |
| # ------------------------------------------------------- | |
| brew install libxml2 | |
| # Install libxslt from source code | |
| # If you don't have wget, follow the instructions at: | |
| # http://www.mactricksandtips.com/2008/07/installing-wget-on-your-mac-for-terminal.html | |
| # Or use Homebrew: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Clone rbenv into ~/.rbenv | |
| git clone git@github.com:sstephenson/rbenv.git ~/.rbenv | |
| # Add rbenv to your PATH | |
| # NOTE: rbenv is *NOT* compatible with rvm, so you'll need to | |
| # remove rvm from your profile if it's present. (This is because | |
| # rvm overrides the `gem` command.) | |
| echo 'export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"' >> ~/.bash_profile | |
| exec $SHELL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'formula' | |
| class Mpd < Formula | |
| homepage 'http://mpd.wikia.com' | |
| url 'http://sourceforge.net/projects/musicpd/files/mpd/0.17.1/mpd-0.17.1.tar.bz2' | |
| sha1 '11da36217d57d08010f309977a4a77cce6240f77' | |
| head 'git://git.musicpd.org/master/mpd.git' | |
| option 'lastfm', 'Compile with experimental support for Last.fm radio' |