Skip to content

Instantly share code, notes, and snippets.

View vast's full-sized avatar
🏠
Working from home

Vasily Polovnyov vast

🏠
Working from home
View GitHub Profile
@vast
vast / werefuckedup.md
Created August 7, 2015 10:06
werefuckedup.md

While working on PD-5217 we noticed some tables which should not exist and decided to drop them instead of adding timestamps to them.

We added corresponding migrations with drop_table and merged them into integration. Deploy passed as expected on CA staging, but errored on US (EY) staging.

Unfortunately, it was unclear from deploy logs what exactly happened:

+ 3m 31s StandardError: An error has occurred, this and all later migrations canceled:
@vast
vast / gulpfile.coffee
Created February 24, 2015 18:49
gulp & postcss integration
gulp = require "gulp"
gutil = require "gulp-util"
plumber = require "gulp-plumber"
app_config = require "../config/application"
postprocessors = require "../config/postcss"
gulp.task "stylesheets", ["clean:stylesheets"], ->
gulp.src(app_config.paths.main_stylesheet)
.pipe(plumber())
@vast
vast / Gemfile.rb
Last active August 29, 2015 14:05
IE8 and Foundation 5 support
source 'https://rubygems.org'
gem 'rails', '4.1.5'
# ...
gem 'rails-pixrem', github: 'vast/rails-pixrem'
scope :complete, ->(value) { where(summary_status: 'complete', state: 'active').limit(value) }
scope :accessible_by_user, ->(user) do
includes(:assignee_tasks)
.where('tasks.user_id = :user_id OR assignee_tasks.user_id = :user_id', user_id: user.id)
end
scope :accessible_by_user_with_state, ->(user, state) do
accessible_by_user(user).where('tasks.state = :state OR assignee_tasks.state = :state', :state)
end
@vast
vast / dabblet.css
Created September 30, 2013 14:46
Kursk
/**
* Kursk
*/
html, body {
height: 100%;
min-height: 100%;
margin: 0;
padding: 0;
}
@vast
vast / dabblet.css
Created August 28, 2013 10:02
House M.D. in css/html
/* House M.D. in css/html */
body {
background: #0e0e0e;
color: #fff;
text-align: center;
}
h2 {
text-transform: uppercase;
@vast
vast / dabblet.css
Created March 22, 2013 07:57
Квадратиш, практиш, CSS
/* Квадратиш, практиш, CSS */
.container {
display: inline-block;
position: relative;
width: 20%; /* whatever */
margin: 0 40%;
}
.blank-gif {
@vast
vast / dabblet.css
Created February 22, 2013 08:59
Untitled
body {
text-align: center;
margin: 2em 0;
}
.loading-indicator,
.loading-indicator:before,
.loading-indicator:after {
display: inline-block;
min-width: 32px;
@vast
vast / dabblet.css
Created February 22, 2013 08:58
Untitled
.loading-indicator:before {
display: inline-block;
content: '•';
}
.loading-indicator:after {
display: inline-block;
content: '•';
}
@vast
vast / Rakefile
Created April 28, 2010 08:44
Interactive console for sinatra + activerecord
require 'my-sinatra-app'
require 'sinatra/activerecord/rake'
desc "run irb console"
task :console, :environment do |t, args|
ENV['RACK_ENV'] = args[:environment] || 'development'
exec "irb -r irb/completion -r my-sinatra-app"
end