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 application_props | |
{ | |
routes: { user: { new: "/..." } }, | |
special_integer: 42 | |
} | |
end | |
def react_props!(obj) | |
application_props.merge(obj.as_json).to_json | |
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
var Hello = React.createClass({ | |
getInitialState: function() { | |
return { | |
message: "hi hi hi", | |
color: "red" | |
} | |
}, | |
updateMessage: function(event) { | |
var newValue = event.target.value; |
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
(1..100).each do |x| | |
if x%15 == 0 | |
puts "CracklePop" | |
elsif x%3 == 0 | |
puts "Crackle" | |
elsif x%5 == 0; | |
puts "Pop" | |
else | |
puts x | |
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
function countdown(seconds) { | |
console.log(seconds); | |
window.setTimeout(function(){ | |
if (seconds !== 0) { | |
countdown(seconds - 1); | |
} | |
}, 1000); | |
} | |
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
$('#transaction_recipient').on 'change', -> | |
switch $(this).val() | |
when 'artist' then hide_and_slide('artist') | |
when 'venue' then hide_and_slide('venue') | |
when 'affiliate' then hide_and_slide('affiliate') |
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 gen_sql | |
relation = Set | |
@recipient ||= "company" | |
@date_window ||= "1year" | |
case @date_window | |
when "1day" |
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
Failures: | |
1) UsersController GET 'name:string' returns http success | |
Failure/Error: get 'name:string' | |
AbstractController::ActionNotFound: | |
The action 'name:string' could not be found for UsersController | |
# ./spec/controllers/users_controller_spec.rb:6:in `block (3 levels) in <top (required)>' | |
2) UsersController GET 'email:string' returns http success | |
Failure/Error: get 'email:string' |
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
$ rails console | |
Loading development environment (Rails 3.2.1) | |
1.9.3-p0 :001 > User.first.remember_token | |
User Load (0.6ms) SELECT "users".* FROM "users" LIMIT 1 | |
NoMethodError: undefined method `remember_token' for #<User:0x007fec96cf9830> | |
from /Users/Will/.rvm/gems/ruby-1.9.3-p0@rails313/gems/activemodel-3.2.1/lib/active_model/attribute_methods.rb:407:in `method_missing' | |
from /Users/Will/.rvm/gems/ruby-1.9.3-p0@rails313/gems/activerecord-3.2.1/lib/active_record/attribute_methods.rb:126:in `method_missing' | |
from (irb):1 | |
from /Users/Will/.rvm/gems/ruby-1.9.3-p0@rails313/gems/railties-3.2.1/lib/rails/commands/console.rb:47:in `start' | |
from /Users/Will/.rvm/gems/ruby-1.9.3-p0@rails313/gems/railties-3.2.1/lib/rails/commands/console.rb:8:in `start' |
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
routes.db | |
Second::Application.routes.draw do | |
resources :users | |
resources :sessions, only: [:new, :create, :destroy] | |
match '/signup', to: 'users#new' | |
match '/signin', to: 'sessions#new' | |
match '/signout', to: 'sessions#destroy', via: :delete | |
match '/help', to: 'static_pages#help' |
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
* actionmailer (3.2.1) | |
* actionpack (3.2.1) | |
* activemodel (3.2.1) | |
* activerecord (3.2.1) | |
* activeresource (3.2.1) | |
* activesupport (3.2.1) | |
* annotate (2.4.1.beta1) | |
* arel (3.0.2) | |
* bcrypt-ruby (3.0.1) | |
* builder (3.0.0) |
NewerOlder