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 'nokogiri' | |
require 'excon' | |
require 'active_support/time' | |
require 'pp' | |
sch = [] | |
(2..17).each do |day| | |
day_of_month = day + 6 | |
response = Excon.get("http://www.sochi2014.com/ezhednevnoe-raspisanie-den-#{day}") | |
page = Nokogiri::HTML(response.body) |
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
module Slugeable | |
extend ActiveSupport::Concern | |
included do | |
extend FriendlyId | |
friendly_id :slug_candidates, use: :slugged | |
def slug_candidates | |
if defined?(self.posted_at) | |
"#{posted_at}-#{name}" |
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
$ cat /var/log/upstart/drone.log | |
2014/04/06 15:04:10 Database already up-to-date. | |
2014/04/06 15:04:10 starting drone version 2a009fa on port :8081 | |
2014/04/06 20:03:56 Database already up-to-date. | |
2014/04/06 20:03:56 starting drone version 2a009fa on port :8081 | |
2014/04/06 20:05:20 Database already up-to-date. | |
2014/04/06 20:05:20 starting drone version 2a009fa on port :8081 | |
2014/04/06 20:11:11 error updating github status: Not Found | |
starting service container bradrydzewski/postgres:9.1 | |
creating build image |
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
Program.all.each do |p| | |
p.update_attribute(:hours, "до 8 часов") if p.hours.blank? | |
p.update_attribute(:peoples, "до 300 человек") if p.peoples.blank? | |
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
namespace :deploy do | |
before 'deploy:assets:precompile', :clean_css_cache do | |
on roles(:app), in: :sequence, wait: 5 do | |
within release_path do | |
if test("[ -d #{shared_path}/tmp/cache/assets ]") | |
if test("[ -d #{shared_path}/tmp/cache/assets/production ]") | |
if test("[ -d #{shared_path}/tmp/cache/assets/production/sprockets ]") | |
out = capture("grep -r -l 'application.css' #{shared_path}/tmp/cache/assets/production/sprockets/") | |
out.split("\n").each do |o| | |
execute :rm, o.gsub("\r", '').to_s |
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
hash = {lists: @lists} | |
hash.merge!(default: @lists.index(@default_list)) if @default_list | |
hash.to_json |
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
if ENV['RAILS_ENV'] == 'production' | |
puts "USING PATCHED CARRIERWAVE" | |
module CarrierWave | |
module Uploader | |
module Url | |
def url(options = {}) | |
if file.respond_to?(:path) |
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
package migrationutil | |
import ( | |
m "github.com/drone/drone/server/database/migrationutil" | |
) | |
// Test create table | |
type Migrate_100000000001 struct{} |
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
scope :contains, -> (point) { where("ST_contains(polygon, ST_Transform(ST_GeomFromText('#{point}', 4326), 4326))") } |
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
<!doctype html> | |
<html> | |
<head> | |
</head> | |
<body> | |
<h1>Web Font Loader Demos</h1> | |
<p> | |
Demonstrations of pure CSS and JavaScript-enhanced use of @font-face. | |
</p> |
OlderNewer