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
class AddPriceToProduct < ActiveRecord::Migration | |
def self.up | |
options = {:precision => 8, :scale => 2, :default => 0} | |
add_column :products, :decimal, options | |
add_column :price, :decimal, options | |
end | |
def self.down | |
remove_column :products, :price |
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
def self.find_by_permalink(link) | |
cat = nil | |
if link.to_i == 0 | |
cat = Category.find_by_name(link.gsub(/ /, "-").titlecase) | |
else | |
cat = Category.find(link) | |
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
irb(main):003:0> a = [['a', 1], ['b', 2], ['c', 3]] | |
=> [["a", 1], ["b", 2], ["c", 3]] | |
irb(main):004:0> a.flatten | |
=> ["a", 1, "b", 2, "c", 3] | |
irb(main):005:0> b = {} | |
=> {} | |
irb(main):006:0> a.each{|p| b[p[0]] = p[1] } | |
=> [["a", 1], ["b", 2], ["c", 3]] | |
irb(main):007:0> b | |
=> {"a"=>1, "b"=>2, "c"=>3} |
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
private struct BoxInstance | |
{ | |
public Vector3 position; | |
public Vector3 dimensions; | |
public Vector3 rotation; | |
public Vector4 color; | |
public bool inUse; | |
//***************************************************************** |
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
############################################################# | |
# Application | |
############################################################# | |
set :application, "" #your app's name here | |
set :server_ip, "" #your server's ip here | |
set :deploy_to, "/home/rails/#{application}" #the path to your rails app here | |
############################################################# | |
# Servers |
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
# this is in application.rb. Yes, I'm lazy. | |
# holy mess, batman! | |
uses_tiny_mce(:options => { :theme => 'advanced', | |
:mode => "textareas", | |
:convert_urls => false, | |
:remove_script_host => true, | |
:theme_advanced_toolbar_location => "top", | |
:theme_advanced_toolbar_align => "left", | |
:theme_advanced_resizing => true, |
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
qrush@q-laptop ~/Sources> git clone git://github.com/why/shoes.git | |
Initialized empty Git repository in /home/qrush/Sources/shoes/.git/ | |
remote: Counting objects: 5925, done. | |
remote: Compressing objects: 100% (1774/1774remote: ), done. | |
remote: Total 5925 (delta 4079), reused 5925 (delta 4079) | |
Receiving objects: 100% (5925/5925), 1.96 MiB | 225 KiB/s, done. | |
Resolving deltas: 100% (4079/4079), done. | |
qrush@q-laptop ~/Sources> cd shoes/ | |
qrush@q-laptop ~/S/shoes> rake | |
(in /home/qrush/Sources/shoes) |
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
Loading development environment (Rails 2.1.1) | |
Missing the Rails 2.1.1 gem. Please `gem install -v=2.1.1 rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed. | |
qrush@q-imac ~/D/r/medqd> gem list | grep rails | |
gemsonrails (0.7.2) | |
rails (2.1.1) |
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
Mike, | |
Hello, I am from approximately two months in the future. On 10/22 at approx 2:34am CET a tachyon | |
field failure in the main resonating ring of the LHC causes a "temporal blowback". Shortly | |
thereafter, the resulting destruction of the strong nuclear force causes the world to vaporize in | |
seconds, while a few of us near the experiment are thrown into a temporal causality loop. While | |
the predestination event (or as we have come to call it "The Big Rewind") hasn't occurred yet to | |
you, for us it is about three years in our past. I came across your site looking to see if there | |
were any other scientists that may have theorized this phenomenon who may be of assistance in | |
preventing it. This brings me to my point, I have repeatedly checked your site for the past five |
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
Sep 11 01:49:19 mydomain postfix/smtpd[11154]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 550 5.1.1 <[email protected]>: Recipient address rejec | |
ted: User unknown in local recipient table; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<localhost.localdomain> | |
S |
OlderNewer