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 Post | |
include Mongoid::Document | |
field :author | |
field :text | |
field :publish_date, :type => Date | |
embeds_many :comments | |
index [:author, :asc] | |
end | |
class Comment |
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 Awesomeapp::Resque < Resque::Server | |
# Will redirect back to rails app to require a sign in | |
before do | |
env['warden'].authenticate! | |
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
require 'libsvm' | |
# This library is namespaced. | |
problem = Libsvm::Problem.new | |
parameter = Libsvm::SvmParameter.new | |
parameter.cache_size = 1 # in megabytes | |
parameter.eps = 0.001 | |
parameter.c = 10 |
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
./configure --interfaces=ruby_modular --libs=/Users/rimas/.rvm/rubies/ruby-1.9.2-p290/lib --rubydir=/Users/rimas/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/x86_64-darwin10.8.0 |
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
config.action_mailer.raise_delivery_errors = true | |
config.action_mailer.default_url_options = { :host => 'localhost:3000' } | |
config.action_mailer.perform_deliveries = false | |
config.action_mailer.default :charset => "utf-8" | |
config.active_support.deprecation = :log | |
config.mongo_fifo = MongoFifo::Store.new(Mongo::Connection.new['mongo_fifo']) |
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
j = Job.allocate | |
j.init_with('attributes' => {'name' => 'Awesome Shop', 'title' => 'Test Job', 'status' => 'complete'}) | |
j.title # => 'Test Job' |
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
{ | |
"title": "Creating great content", | |
"content": "Ive got nothing", | |
"comments": [ | |
] | |
"version": 2 | |
"versions": [ | |
{ "title": "Creating great content", "version": 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
<html> | |
<head> | |
<%= javascript_include_tag 'application' %> | |
</head> | |
<body> | |
Use sweet js functions here | |
</body> | |
</html> |
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
require 'zoho_invoice' | |
client = ZohoInvoice::Client.new(:authtoken => 'my authtoken', :apikey => 'my apikey') | |
invoice = ZohoInvoice::Invoice.new(client, :customer_id => 'asdf') | |
invoice.save | |
invoice = client.invoices.new(:customer_id => 'asdf') | |
invoice.save |
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
# Background: | |
# I followed the initial url and your message suggested that I try json instead. | |
# Using that, I hit the initial page and tagged '.json' on to the url. You had | |
# mentioned in your job description that you were using rails so I figured I could | |
# do that in the URL instead of using the accept headers. | |
# | |
require 'rest-client' | |
require 'json' | |