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
| 188 cd | |
| 189 sudo apt-get remove ffmpeg x264 libx264-dev yasm | |
| 190 sudo apt-get update | |
| 191 sudo apt-get install build-essential git-core checkinstall texi2html libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libtheora-dev libvorbis-dev libx11-dev libxfixes-dev zlib1g-dev | |
| 192 cd | |
| 193 wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz | |
| 194 tar xzvf yasm-1.2.0.tar.gz | |
| 195 cd yasm-1.2.0 | |
| 196 ./configure | |
| 197 make |
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
| # Put this in ~/.zshrc | |
| chpwd() { | |
| if [ -f ".env" ]; then source .env; fi | |
| } | |
| # Then make .env files in your project directories that look like this. | |
| export S3_SECRET="<s3_secret>" | |
| export S3_KEY="<s3_key>" | |
| # Then add .env to ~/.gitignore |
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
| module Foo | |
| class Railtie < Rails::Railtie | |
| initializer "foo.insert_middleware" do |app| | |
| app.config.middleware.use "Foo::Middleware" | |
| end | |
| end | |
| end | |
| require "foo/railtie" if defined? Rails |
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
| // This is the main application configuration file. It is a Grunt | |
| // configuration file, which you can learn more about here: | |
| // https://github.com/cowboy/grunt/blob/master/docs/configuring.md | |
| // | |
| module.exports = function(grunt) { | |
| grunt.initConfig({ | |
| // The clean task ensures all files are removed from the dist/ directory so | |
| // that no files linger from previous builds. |
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
| ├── Gemfile | |
| ├── Thorfile | |
| ├── client | |
| │ ├── app | |
| │ │ ├── config.js | |
| │ │ ├── farmhand.js | |
| │ │ ├── main.js | |
| │ │ ├── modules | |
| │ │ │ └── crop.js | |
| │ │ └── templates |
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
| // Fast | |
| var http = require('http'); | |
| http.Server(function(req, res) { | |
| res.writeHead(200); | |
| res.end("hello world\n"); | |
| }).listen(8000); | |
| // Faster | |
| var cluster = require('cluster'); |
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
| /Users/collin/dev/farmhand_dev/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/context.rb:100: [BUG] Segmentation fault | |
| ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.3.0] | |
| -- Control frame information ----------------------------------------------- | |
| c:0037 p:---- s:0146 b:0146 l:000145 d:000145 CFUNC :Enter | |
| c:0036 p:0043 s:0143 b:0143 l:000142 d:000142 METHOD /Users/collin/dev/farmhand_dev/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/context.rb:100 | |
| c:0035 p:0165 s:0140 b:0140 l:000130 d:000139 BLOCK /Users/collin/dev/farmhand_dev/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/context.rb:21 | |
| c:0034 p:0028 s:0135 b:0135 l:000134 d:000134 METHOD /Users/collin/dev/farmhand_dev/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/portal.rb:16 | |
| c:0033 p:0057 s:0131 b:0131 l:000130 d:000130 METHOD /Users/collin/dev/farmhand_dev/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/context.rb:10 | |
| c:0032 p:---- s:0127 b:0127 l:000126 d:000126 FINISH |
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
| # Bicycle example for bdw / intro to programming class week 3, basics of methods. | |
| # I'm a method without variables | |
| def ride | |
| "OK, we're rolling..." | |
| end | |
| # I'm a method with variables | |
| def gear_ratio(gearing) | |
| (gearing[:front_chainring_gear].to_f / gearing[:rear_chainring_gear].to_f).round(2) |
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
| # OO for the win! | |
| # Bike class | |
| # Classes in Ruby are Capitalized and are defined like so... | |
| class Bike | |
| # Accessors are handy, this is the equivalant of | |
| # | |
| # def state | |
| # @state |
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
| class Hood | |
| attr_accessor :houses | |
| def initialize(houses) | |
| @houses = houses | |
| end | |
| def house_count | |
| @houses.count | |
| end |