This guide supports Ubuntu Precise Pangolin 12.04, Ubuntu Oneiric Ocelot 11.10, Ubuntu Natty Narwhal 11.04, and Ubuntu Maverick Meerkat 10.10. Separate guides are available for Ubuntu Lucid Lynx 10.04 and Ubuntu Hardy Heron 8.04. This guide will enable several external encoding and decoding libraries: libfaac (AAC encoder), libfdk-aac (AAC encoder), libmp3lame (MP3 encoder), libopencore-amr (AMR encoder/decoder), librtmp (for additional RTMP protocols), libtheora (Theora encoder), libvorbis (Vorbis encoder), libvpx (VP8 encoder/decoder), and libx264 (H.264 encoder). These are optional and may be omitted if desired. This guide will also install many filters (see the filter list in the [Filtering Guide](https://ffmpeg.org/trac/ffmpeg/wiki/Fi
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
gem 'rails', '3.2.1' | |
require 'active_record' | |
puts "Active Record #{ActiveRecord::VERSION::STRING}" | |
ActiveRecord::Base.establish_connection( | |
:adapter => 'sqlite3', | |
:database => ':memory:' | |
) |
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 'erb' | |
require 'net/http' | |
require 'json' | |
template = %q{ | |
This is one: <%= data_obj.one %> | |
The foo is <%= data_obj.foo %> | |
} | |
class MyDataObj |
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
#!env ruby | |
# This script enables 'Natural scrolling' as in OS X. | |
# | |
# Usage: | |
# 1. Find your touchpad name by running xinput list | |
# 2. Run ./natural_scroll.rb 'touchpad name' | |
# | |
# Limitations: | |
# - Tested only on Ubuntu 13.04 |
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
#TODO: | |
# 1. Set up unicorn as service | |
# 2. Set nginx config | |
# 3. Create deploy | |
require "debugger" | |
$:<< File.join(File.dirname(__FILE__), 'stack') | |
$:<< File.join(File.dirname(__FILE__), 'lib') | |
require "capistrano_vars" |
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
## | |
# Unsets constant `const_name` from all available Modules. | |
# Will not do anything, if constant not constantizable. | |
# | |
# Params: | |
# - const_name {Symbol} or {String} name of constant, | |
# able to be constantized | |
# | |
# Returns {Boolean} as a result of unsetting | |
def unset_const!(const_name) |
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
# Load models | |
Dir.foreach("app/models") { |f| require f if f =~ /rb$/ } | |
ActiveRecord::Base.descendants.each do |klass| | |
next if klass == "Rack::OAuth2::Server::Issuer".safe_constantize or klass == "Rack::OAuth2::Server::ActiveRecord".safe_constantize | |
begin | |
klass.columns.each_with_index {|c, i| printf "%-20s | %-19s | %-29s | %-10s\n", (i==0 ? klass.name : ''), c.name, c.sql_type, (c.null ? '' : 'not null') } | |
rescue => e | |
puts "*"*10 | |
puts "Error getting columns for #{klass}: #{e}" |
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
user system total real | |
Date 38.260000 0.290000 38.550000 ( 39.010656) | |
Bool 2.180000 0.000000 2.180000 ( 2.197462) | |
=> [ 38.260000 0.290000 38.550000 ( 39.010656) | |
, | |
2.180000 0.000000 2.180000 ( 2.197462) | |
] |
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
source :rubygems | |
gem 'pg' | |
gem "hashie" | |
gem 'activerecord', require: 'active_record' | |
gem 'activesupport' | |
gem 'activeresource', :require => 'active_resource' | |
gem "debugger" |
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
source :rubygems | |
gem 'pg' | |
gem 'activesupport' | |
gem "debugger" | |
# DM2 staff | |
gem 'dm-mapper', git: "https://github.com/solnic/dm-mapper.git" |