View stats.rb
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 Stats | |
class << self | |
def weekly_progress(issue_ids) | |
relation = Issue.where(id: issue_ids) | |
.order('year asc, week asc') | |
.group('year, week') | |
all = <<-SQL | |
date_part('week', created_at) as week, | |
date_part('year', created_at) as year, |
View gist:9d8d4c441d0e37653f71
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 "selenium-webdriver" | |
class ScratchLogger | |
def create_accounts(count, username, password) | |
1.upto(count).each do |i| | |
create_account("#{username}#{i}", "#{password}#{i}", "gcfcampus2016@gmail.com", "Styczeń", "2006") | |
end | |
end |
View user_avatar.rb
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
User.where(provider: "facebook").each do |user| | |
secure_avatar_url = user.passenger.avatar_url.sub('http:', '') | |
user.passenger.update_attribute(:avatar_url, secure_avatar_url) | |
end |
View wrong_stations.js
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
wrongStations: function() { | |
var wrongStations = []; | |
$.each(this.store.all('station').content, function(i, station) { | |
if (station.get('name').parameterize() !== station.get('slug')) { | |
console.log(station.get('id'), station.get('name').parameterize(), station.get('slug')); | |
wrongStations.pushObject(station); | |
} | |
}); | |
return wrongStations; | |
} |