This file contains hidden or 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 API = function () { | |
}; | |
API.prototype.login = function(username, password) { | |
console.log("request username and pw to server..."); | |
this.auth_token = "nhonhonho"; | |
}; | |
API.prototype.getUserById = function(user_id) { | |
if (this.auth_token){ |
This file contains hidden or 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
namespace :assets do | |
desc "fetch descriptions for youtube videos without descriptions" | |
task yt_fetch_description: :environment do | |
BsuDescriptionUpdater.new(YtChanReg, FbPgeReg, IgUsrReg).update_all | |
end | |
end | |
class BsuDescriptionUpdater | |
def initialize(*source_klasses) | |
@source_klasses = source_klasses.map { |src| DescriptionUpdater.new(src) } |
This file contains hidden or 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 'sprockets' | |
require 'pry' | |
require 'fileutils' | |
namespace :karma do | |
task :start => :environment do | |
with_tmp_config :start | |
end | |
task :run => :environment do |
This file contains hidden or 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 'sprockets' | |
namespace :karma do | |
task :start => :environment do | |
with_tmp_config :start | |
end | |
task :run => :environment do | |
with_tmp_config :start, "--single-run" | |
end |
This file contains hidden or 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
# get it ready | |
git bisect start | |
git bisect good c09c728 | |
git bisect bad e6a0692 | |
# give git a command to run against each commit | |
git bisect run rspec spec/features/my_broken_spec.rb |
This file contains hidden or 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 used to identify if a string it considered clickbait | |
class Spotlight::Examiner | |
attr_accessor :text, :filters | |
def initialize(text: '', filters: [ WordFilter.new, RegexFilter.new]) | |
@text = text || '' | |
@filters = filters | |
end |
This file contains hidden or 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
src/ebench/Ishango2 feat/37-improve-test-suite ✗ | |
▶ rspec spec/models/fb_pst_reg_spec.rb -p | |
........ | |
Top 8 slowest examples (27.32 seconds, 100.0% of total time): | |
FbPstReg update some fb post regs | |
4.95 seconds ./spec/models/fb_pst_reg_spec.rb:22 | |
FbPstReg should update imp factor by licosh | |
4.49 seconds ./spec/models/fb_pst_reg_spec.rb:72 | |
FbPstReg create some fb post regs |
This file contains hidden or 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 'rails_helper' | |
describe 'the problem' | |
it 'only creates a tweet after the third factry invocation' | |
puts "There are " + Category.count.to_s + " categories in the db" | |
3.times do | |
begin | |
FactoryGirl.build( :twtr_tweet_reg ) | |
rescue Exception => e | |
puts "Tryied to create category with name" + e.name.to_s | |
end |
This file contains hidden or 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
# place me inside the helpers folder on the root of the middleman project | |
# ex.: | |
# (given that you have an image name slider.jpg inside the images folder) | |
# | |
# slider_image() | |
# => "<img src=\"slider.jpg\" />" | |
# | |
# slider_image( class: 'foo', 'data-attribute': 'bar') | |
# => "<img class=\"foo\" data-attribute=\"bar\" src=\"slider.jpg\" />" |