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
| ActiveRecord::Base.include_root_in_json = false |
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
| [{ | |
| "roles": [{ | |
| "name": "Admin" | |
| }], | |
| "city": "Boulder", | |
| "employers": [{ | |
| "title": "Quick Left" | |
| }], | |
| "state": "CO", | |
| "full_name": "Collin Schaafsma" |
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
| def edge_case | |
| render :json => @users.as_json(:only => [:first_name, :state]) | |
| end |
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 User < ActiveRecord::Base | |
| has_and_belongs_to_many :employers | |
| has_and_belongs_to_many :roles | |
| end |
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 Vim < Formula | |
| homepage 'http://www.vim.org/' | |
| url 'ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2' | |
| head 'https://vim.googlecode.com/hg/' | |
| sha256 '5c5d5d6e07f1bbc49b6fe3906ff8a7e39b049928b68195b38e3e3d347100221d' | |
| version '7.3.206' | |
| def features; %w(tiny small normal big huge) end |
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
| Example Rails app | |
| https://github.com/collinschaafsma/loyd | |
| Example Sinatra app | |
| https://github.com/collinschaafsma/slimfit | |
| Awesome talk by Uncle Bob. | |
| http://confreaks.com/videos/759-rubymidwest2011-keynote-architecture-the-lost-years | |
| Clean Code Book |
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
| #!/bin/sh | |
| # | |
| # /etc/init.d/red5 -- startup script for the red5 server | |
| # | |
| # Based on the tomcat6 init script. | |
| # Written by Miquel van Smoorenburg <miquels@cistron.nl>. | |
| # Modified for Ubuntu red5 by Fred Dixon <ffdixon@bigbluebutton.org> | |
| # Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.ai.mit.edu>. | |
| # Modified for Tomcat by Stefan Gybas <sgybas@debian.org>. | |
| # Modified for Tomcat6 by Thierry Carrez <thierry.carrez@ubuntu.com>. |
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 vim /etc/apt/sources.list | |
| #add the following | |
| deb http://us.archive.ubuntu.com/ubuntu/ lucid multiverse | |
| deb-src http://us.archive.ubuntu.com/ubuntu/ lucid multiverse | |
| deb http://us.archive.ubuntu.com/ubuntu/ lucid-updates multiverse | |
| deb-src http://us.archive.ubuntu.com/ubuntu/ lucid-updates multiverse | |
| deb http://archive.canonical.com/ lucid partner | |
| sudo apt-get update | |
| sudo apt-get install java-package |
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
| # On server | |
| addgroup admin | |
| adduser deployer --ingroup admin | |
| # Locally | |
| cat ~/.ssh/id_dsa.pub | ssh deployer@ec2-something.compute-1.amazonaws.com 'mkdir ~/.ssh; cat >> ~/.ssh/authorized_keys' |
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
| # Add speex, for Red5 | |
| brew edit ffmpeg | |
| args << "--enable-libspeex" if Formula.factory('speex').installed? | |
| brew install --use-gcc ffmpeg | |
| # H.264 / ACC | |
| ffmpeg -i video.flv -acodec libfaac -ab 19k -ar 16000 -vsync 1 -async 1 -r 25.0 -b 193k -vcodec libx264 -s 420x340 video.mp4 | |
| # VP8 / Vorbis |