I hereby claim:
- I am maxschulze on github.
- I am sdia_maxschulze (https://keybase.io/sdia_maxschulze) on keybase.
- I have a public key ASC5hWmLCj_4FAAVg5Bqk5x51Fq_uVNoH5ZPKqIAAsfhwQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
websocket = new WebSocket("ws://localhost:8080/"); | |
websocket.onmessage = function(evt) { | |
$('#messages').append($('<li>').html(evt.data)); | |
}; | |
websocket.onerror = function(evt) { | |
$('#messages').append($('<li>').text('<span style="color: red;">ERROR:</span> ' + evt.data)); | |
}; |
$(document).ready -> | |
$("[placeholder]").focus(-> | |
input = $(this) | |
if input.val() is input.attr("placeholder") | |
input.val "" | |
input.removeClass "placeholder" | |
).blur(-> | |
input = $(this) | |
if input.val() is "" or input.val() is input.attr("placeholder") |
])}while(1);</x>{"success":true,"payload":{"value":{"mediaResourceId":"4d88f1591274c093c3a9118475a648c2","mediaResourceType":"MediaResourceExternalLink","href":"http://instagram.com/p/l7pkYuHtBW/","domain":"instagram.com","title":"At work with @neymarjr and @mariotestino for @voguebrasil 📷💄 No trabalho com @neymarjr e @mariotestino para @voguebrasil","description":"giseleofficial's photo on Instagram","iframeWidth":0,"iframeHeight":0,"iframeSrc":"","type":"MediaResource"},"references":{}},"v":3,"b":"8398-ee46537"} |
class JuryReview | |
# some mongo fields here, not called round_number nor rapper_slug | |
# Now let's have a getter and setter, these are the names for the form fields as well, e.g. | |
# f.select :rapper - This should render a select with <option value="ID OF THE RAPPER OR SLUG">WHATEVER</option> | |
# f.input :round_number | |
attr_accessor :round_number, :rapper | |
# Implement the setter first |
describe VotesController do | |
describe "POST 'create'" do | |
it "should return json success" do | |
user_vote = stub_model(UserVote, :save => true) | |
UserVote.stub(:new).with({ip_address: "127.0.0.1", mics: 2, round_id: 1, rapper_id: 1}) { user_vote } | |
post :create, user_vote: { ip_address: "127.0.0.1", mics: 2, round_id: 1, rapper_id: 1 } |
class Credentials | |
include Support::Base | |
attribute :password, String | |
attribute :password_confirmation, String | |
with_options allow_blank: true do |v| | |
v.validates :password, confirmation: { message: proc{ error_msg(:password, :passwords_dont_match) } } | |
v.validates :password, length: { minimum: 8, maximum: 50, message: proc{ error_msg(:password, :invalid) } } | |
# v.validates :password, format: { with: /[^[:alpha:]]/ } |
# cumulative line chart | |
cumulativeChart = buildCumulativeChart(rows, "start_date") | |
cumulativeChart.addLine("CTR" ,"ctr") | |
cumulativeChart.addLine("CR", "cr") | |
cumulativeChart.addLine("ROI", "roi") | |
cumulativeChart.draw("#chart1") | |
#!/bin/bash -l | |
source "$HOME/.rvm/scripts/rvm" | |
# Use the correct ruby | |
rvm --create "1.9.2-p136@project" | |
gem install bundler | |
export RAILS_ENV=test | |
export DISPLAY=:99 |
namespace :cover_me do | |
task :report do | |
puts "Reporting!" | |
CoverMe.config.formatter = CoverMe::EmmaFormatter | |
CoverMe.config.at_exit = Proc.new {} | |
CoverMe.complete! | |
end | |
end | |
task :spec do |