$ rails g model User
belongs_to
has_one
1.9.2-p290 :002 > u = Upload.new | |
=> #<Upload id: nil, post_id: nil, created_at: nil, updated_at: nil, upload_file_name: nil, upload_content_type: nil, upload_file_size: nil, upload_updated_at: nil> | |
1.9.2-p290 :004 > u.upload = File.open('/Users/Eric/Desktop/estimation grid.png') | |
=> #<File:/Users/Eric/Desktop/estimation grid.png> | |
1.9.2-p290 :005 > u.save! | |
(0.1ms) begin transaction | |
SQL (17.4ms) INSERT INTO "uploads" ("created_at", "post_id", "updated_at", "upload_content_type", "upload_file_name", "upload_file_size", "upload_updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 16 Mar 2012 16:13:46 UTC +00:00], ["post_id", nil], ["updated_at", Fri, 16 Mar 2012 16:13:46 UTC +00:00], ["upload_content_type", "image/png"], ["upload_file_name", "estimation_grid.png"], ["upload_file_size", 53079], ["upload_updated_at", Fri, 16 Mar 2012 16:13:43 UTC +00:00]] | |
(23.8ms) commit transaction |
#!/usr/bin/env ruby | |
require 'selenium-webdriver' | |
require 'uri' | |
website_url = ARGV[0] | |
if website_url.empty? | |
puts "Website Argument Required.\n" | |
exit() | |
end |
[user] | |
name = Eric London | |
email = [email protected] | |
[core] | |
excludesfile = /Users/Eric/.gitignore | |
[alias] | |
lg = log --graph --pretty=format:'%C(red)%h%Creset%C(yellow)%d%Creset %C(bold blue)%an%Creset %C(green)%cr%Creset %s' --abbrev-commit --date=relative --all | |
lg2 = log --graph --pretty=format:'%C(red)%h%Creset%C(yellow)%d%Creset %C(bold blue)%an%Creset %C(green)%cr%Creset %s' --abbrev-commit --date=relative | |
[color] | |
ui = auto |
framework 'AppKit' | |
class Download | |
attr_reader :response, :responseBody | |
def start(request) | |
puts "START!" | |
NSURLConnection.connectionWithRequest(request, delegate:self) | |
end |
require 'active_support/concern' | |
module ChildTrackable | |
extend ActiveSupport::Concern | |
# keep track of what classes have included this concern: | |
module Children | |
extend self | |
@included_in ||= [] |
# I had nginx and passenger already installed via brew: | |
# note: this caused problems with RVM & gemsets | |
brew uninstall nginx passenger | |
brew cleanup | |
########## | |
# from the IMS rails project: | |
# note/todo: add to Gemfile? | |
gem install passenger -v 5.0.10 |
var run_cmd = function(cmd, args, callBack) { | |
var spawn = require('child_process').spawn; | |
var child = spawn(cmd, args); | |
var resp = ""; | |
child.stdout.on('data', function (buffer) { resp += buffer.toString() }); | |
child.stdout.on('end', function() { callBack (resp) }); | |
} | |
var check_ps_aux = function(service) { |
require 'capybara/rspec' | |
require 'capybara/poltergeist' | |
Capybara.register_driver :poltergeist do |app| | |
Capybara::Poltergeist::Driver.new(app, { | |
debug: true, | |
timeout: 120, | |
js_errors: true, | |
inspector: true, | |
phantomjs_options: ['--load-images=no', '--ignore-ssl-errors=yes'], |
# all emoji | |
# 1000.times { |i| emoji(127740 + i) + ' ' } | |
# moon phases | |
# 8.times { |i| emoji(127761 + i) } | |
DELAY = 0.3; | |
# clean screen | |
def clean |