Skip to content

Instantly share code, notes, and snippets.

View killthekitten's full-sized avatar
🇺🇦

Nikolay Shebanov killthekitten

🇺🇦
View GitHub Profile
.b-box {
overflow: hidden;
margin: 0 0 20px 0;
border-radius: 7px;
box-shadow: 1px 1px 2px rgba(0, 0, 0, .2);
background: #f4f4f4;
> header {
border-radius: 7px 7px 0 0;
padding: 8px 0 8px 0px;
@killthekitten
killthekitten / arrow.css.scss
Created February 19, 2013 07:04
Arrow button in Sass
$gl-padding: 17px;
$gl-real-height: 70px;
$gl-height: $gl-real-height - $gl-padding * 2;
$gl-arrow-width: $gl-real-height / 2;
$gl-arrow-height: $gl-real-height / sqrt(3);
$gl-arrow-degree: -1 * rad-to-deg(atan($gl-arrow-width / $gl-arrow-height));
$gl-margin-vertical: -1 * (($gl-arrow-height - 1) / 2);
$gl-margin-horizontal: -1 * (($gl-arrow-width + 1) / 2);
@mixin gl-arrow($first-color, $second-color) {
@killthekitten
killthekitten / custom_searcher.rb
Last active December 10, 2015 20:08 — forked from ashga/product_decorator.rb
Dumb way to filter products by multiple properties in Spree.
class CustomSearch < Spree::Core::Search::Base
protected
def add_search_scopes(base_scope)
statement = nil
search.each do |property_name, property_values|
property = Spree::Property.find_by_name(property_name.gsub("_any", ""))
next unless property
substatement = product_property[:property_id].eq(property.id).and(product_property[:value].eq(property_values.first))
@killthekitten
killthekitten / README.md
Last active December 10, 2015 11:59 — forked from oguzbilgic/README.md

MyApp

Very short description of the application.

1. Ruby, Rails & Rubygems

Application is written in ruby language, using Ruby on Rails web framework.

@killthekitten
killthekitten / index.html
Last active December 10, 2015 00:29
XMas written with CoffeeScript flavor
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<pre>
</pre>
@killthekitten
killthekitten / stuff.cpp
Created December 11, 2012 21:48
Gistflow stuff
"Gistflow.com"
@killthekitten
killthekitten / gist:2930846
Created June 14, 2012 14:57
Задачки
1
JavaScript
3
howManyYears += 1;
Оператор += в js допускает конкатенацию числа со строкой, соответственно нужно убрать кавычки. В оригинале мы получаем 10, а без кавычек - необходимую единицу.
2
Ruby
2
if (howManyYears != 0)