Skip to content

Instantly share code, notes, and snippets.

View dmitry's full-sized avatar
🇪🇪
Water, earth and air.

Dmitry Polushkin dmitry

🇪🇪
Water, earth and air.
View GitHub Profile
@dmitry
dmitry / gems.md
Last active August 29, 2015 13:57
Gems that is worth to try for the better development in Rails environment.
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
https://github.com/terriblelabs/guardrail_notifier
https://github.com/bumi/validation_rage
https://github.com/watu/validation_auditor
@dmitry
dmitry / bem.scss
Created April 6, 2014 14:41
BEM shortcuts for SASS >= 3.3.0
// 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 April 17, 2014 12:02
active_admin draper decorator workflow
class Admin::BaseDecorator < Draper::Decorator
def self.collection_decorator_class
Admin::CollectionDecorator
end
end
@dmitry
dmitry / rem
Created April 21, 2014 16:33 — forked from xonic/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: "";
@dmitry
dmitry / super-shit-arel-query.rb
Created May 23, 2014 05:18
AREL is super good!
# 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 August 29, 2015 14:03
Homepage on dmitry.eu
{
name: "Dmitry Polushkin",
title: "Software Engineer",
location: ["Tenerife", "Spain", "Earth"],
email: "dmitry.polushkin@gmail.com"
}