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 Enumerable | |
| >> alias_method :transform, :map | |
| >> end | |
| => Enumerable | |
| >> names.transform{|n| n.upcase} | |
| => ["FRYE", "BENDER", "LEELA", "ZOIDBERG"] |
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
| # using_gcc for 64btt compiling on lion (solves compatability issues) | |
| function using_gcc() { | |
| env CC="/usr/bin/gcc-4.2" ARCHFLAGS="-arch x86_32" ARCHS="x86_32" $* | |
| } | |
| #then | |
| using_gcc rvm install ree |
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
| #!/usr/bin/env ruby | |
| require 'set' | |
| @term = ARGV[0] | |
| def set_from_command(command) | |
| result = `#{command}` | |
| Set.new(result.split "\n") | |
| 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
| mencoder -nosound mf://*.jpg -mf w=800:h=371:type=jpg:fps=15 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=2160000:mbd=2:keyint=132:v4mv:vqmin=3:lumi_mask=0.07:dark_mask=0.2:mpeg_quant:scplx_mask=0.1:tcplx_mask=0.1:naq -o face-time-lapse.avi |
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
| irb | |
| >> require 'open-uri' | |
| => true | |
| >> open 'https://www.google.com' | |
| OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server key exchange B: bad ecpoint | |
| from /Users/adam/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/net/http.rb:799:in `connect' | |
| from /Users/adam/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/net/http.rb:799:in `block in connect' | |
| from /Users/adam/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/timeout.rb:54:in `timeout' | |
| from /Users/adam/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/timeout.rb:99:in `timeout' | |
| from /Users/adam/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/net/http.rb:799:in `connect' |
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
| chef_gem 'mysql' | |
| include_recipe "mysql::ruby" | |
| mysql_database node['mysql']['database_name'] do | |
| connection({:host => "localhost", :username => 'root', :password => node['mysql']['server_root_password']}) | |
| action :create | |
| 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
| '(ansi-color-names-vector ["#3f3f3f" "#cc9393" "#7f9f7f" "#f0dfaf" "#8cd0d3" "#dc8cc3" "#93e0e3" "#dcdccc"]) | |
| '(ansi-term-color-vector [unspecified "white" "red" "green" "yellow" "royal blue" "magenta" "cyan" "white"] t) |
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
| (defface term-color-black | |
| '((t :foreground "black" :background "black")) | |
| "Face used to render black color code." | |
| :group 'term) | |
| (defface term-color-red | |
| '((t :foreground "red3" :background "red3")) | |
| "Face used to render red color code." | |
| :group 'term) |
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
| #include <iostream> | |
| #define ASTRO_UNITS_PER_LIGHT_YEAR 63240 | |
| float lightYearsToAstronomicalUnits(float); | |
| int main() | |
| { | |
| using namespace std; | |
| cout << "Enter the number of light years: "; | |
| float lightYears; |
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
| find code-folder/ -name '*.m' -exec pcregrep -M 'init.*(\n|[\{])+\{(\n|[^\}])+self\.(\n|[^\}])+\}' {} \; -exec echo "Filename: " {} \;q |