Skip to content

Instantly share code, notes, and snippets.

Avatar
🇪🇪
Water, earth and air.

Dmitry Polushkin dmitry

🇪🇪
Water, earth and air.
View GitHub Profile
View check_yaml_generation.rb
YAML::ENGINE.yamler = 'psych'
File.open('new/en.yml', 'w') { |f| f.write(Psych.load(File.open('config/locales/en.yml').read).to_yaml) }; 1
check_with = Psych.load(File.open('new/en.yml').read)["en"].to_a; 1
Psych.load(File.open('config/locales/en.yml').read)["en"].to_a.each_with_index do |hash, i|
if check_with[i] != hash
puts hash
View validation errors
https://github.com/terriblelabs/guardrail_notifier
https://github.com/bumi/validation_rage
https://github.com/watu/validation_auditor
@dmitry
dmitry / bem.scss
Created Apr 6, 2014
BEM shortcuts for SASS >= 3.3.0
View bem.scss
// elements get appended with "__" and the $name
@mixin e($name) {
@at-root #{&}__#{$name} {
@content;
}
}
// modifiers get appended with "--" and the $name
@mixin m($name) {
@at-root #{&}--#{$name} {
@dmitry
dmitry / base_decorator.rb
Created Apr 17, 2014
active_admin draper decorator workflow
View base_decorator.rb
class Admin::BaseDecorator < Draper::Decorator
def self.collection_decorator_class
Admin::CollectionDecorator
end
end
@dmitry
dmitry / rem
Created Apr 21, 2014 — forked from xonic/rem
View rem
// Mixin that allows to specify arbitrary CSS properties with
// unitless numbers. The output has rem unit with pixel fallback.
// Shorthand assignments are supported too!
$base_line: 10;
@mixin rem($property, $values, $important:"")
{
// Placeholder variables
$shorthand_px: "";
$shorthand_rem: "";
View super-shit-arel-query.rb
# t = Message.arel_table
# Message.
# joins(:thread).
# where(
# t[:id].eq(
# t.grouping(
# Arel.sql(
# Message.
# select(t[:id]).
@dmitry
dmitry / home.json
Last active Aug 29, 2015
Homepage on dmitry.eu
View home.json
{
name: "Dmitry Polushkin",
title: "Software Engineer",
location: ["Tenerife", "Spain", "Earth"],
email: "dmitry.polushkin@gmail.com"
}
You can’t perform that action at this time.