$ curl -L https://get.rvm.io
$ rvm pkg remove
$ rvm requirements run
This file contains 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
#app/model/user.rb | |
class User < ActiveRecord::Base | |
#Du coup tu peux appeler @user.address => Objet Address instancie | |
:has_one :address | |
end | |
#app/model/address.rb | |
class Address < ActiveRecord::Base | |
#Du coup tu peux appeler @address.user => Objet User instancie | |
:belongs_to :address |
This file contains 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
<!-- Name of the Member --> | |
<h2>Jared Goralnick</h2> | |
<!-- Name of the Member Company --> | |
<a href="http://www.awayfind.com/en">AwayFind</a> | |
<div id="member-social-icons"> | |
<a id="social-twitter" title="my twitter page" href="http://twitter.com/technotheory" target="_blank"> | |
<img class="alignnone" src="http://parisoma.com/wp-content/themes/parisomav2/images/design/twitter_32.png" alt="Sondra's twitter page" width="32" height="32" /> | |
</a> | |
<a href="http://technotheory.com/"> |
This file contains 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
<span style="font-size:10px;color:white;">Tip 1: Find Your Friends</span> | |
<br> | |
<p style="margin-left:20px;font-weight:bold;"> | |
lorem ipsum... | |
</p> |
This file contains 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
["featured_sections.yml", "team.yml","press_articles.yml"].each do |yr| | |
text = File.read(Rails.root.join("config/#{yr}")) | |
$redis.set("yaml_record:" + yr, text) | |
puts "#{yr}: yes!" if text == $redis.get("yaml_record:" + yr) | |
end | |
["partner_shows.yml", "faq.yml"].each do |sf| | |
text = File.read(Rails.root.join("config/#{sf}")) | |
$redis.set("simple_yaml:" + sf, text) | |
puts "#{sf}: yes!" if text == $redis.get("simple_yaml:" + sf) |
This file contains 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 Passenger in Lion | |
http://electronicholas.com/2011/08/passenger-prefpane-1-5-for-mac-os-x-lion-10-7/passenger-prefpane/ | |
Enable web server in "Server App" | |
gem install passenger | |
rvmsudo passenger-install-apache2-module | |
copy commands from output to /etc/apache2/other/passenger.conf | |
Here's an example with ree@integrity gemset |
This file contains 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 Hominid | |
class API | |
def class | |
Hominid::API | |
end | |
end | |
end |
This file contains 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
ruby-1.9.2-p290 :293 > Sideshow.find('4f2b35718de4984840000395').sync_items.map(&:id) | |
[ | |
[ 0] BSON::ObjectId('4f2b35718de4984840000396'), | |
[ 1] BSON::ObjectId('4f2b35718de4984840000396'), | |
[ 2] BSON::ObjectId('4f2b35ad8de498484000039c'), | |
[ 3] BSON::ObjectId('4f2b35ad8de498484000039c'), | |
[ 4] BSON::ObjectId('4f2b35a28de498484000039b'), | |
[ 5] BSON::ObjectId('4f2b35a28de498484000039b'), | |
[ 6] BSON::ObjectId('4f2b35858de498484000039a'), | |
[ 7] BSON::ObjectId('4f2b35858de498484000039a'), |
This file contains 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
# Connection, Tubes, Jobs, Stats | |
@beaneater_connection = Beaneater::Connection.new(['localhost:11300']) | |
### Producer | |
@beaneater_tube = @beaneater_connection.tubes.find_or_create('tube2') | |
@beaneater_tube.put "data", :priority => 1000, :ttr => 10, :delay => 5 | |
# => true | |
### Worker |
This file contains 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 | |
a1 = [8, 2, 1, 5, 9, 10] | |
a2 = [7, 14, 2, 8, 1, 6, 3, 10] | |
# Sort arrays | |
a1.sort!; a2.sort! | |
i,j = 0,0 |
OlderNewer