Skip to content

Instantly share code, notes, and snippets.

View sibsfinx's full-sized avatar
😸

Alexander Mescheryakov sibsfinx

😸
View GitHub Profile
@sibsfinx
sibsfinx / frontend_deploy.sh
Last active August 29, 2015 14:07
Dokku deploy for Middleman project
#!/bin/bash
tmp_branch=tmp_deploy
default_stage=frontend
STAGE=${STAGE:-$default_stage}
current_branch=$(git symbolic-ref --short -q HEAD)
git remote add $STAGE [email protected]:$STAGE
git branch -D $tmp_branch
git checkout -b $tmp_branch
rm -rf app Gemfile Gemfile.lock Guardfile Rakefile config/ config.rb config.ru data/
mv dist/* .
@sibsfinx
sibsfinx / block.html.haml
Created July 7, 2014 07:46
Using test-case attribute
.task-block{ "test-case" => "click-task-block"}
-# markup
@sibsfinx
sibsfinx / css2sass.sh
Last active August 29, 2015 14:03
CSS and SCSS to SASS
#!/bin/bash
for f in *.css; do sass-convert $f ${f%css}sass ; done
rm *.css
@sibsfinx
sibsfinx / rm_popovers.js
Created July 7, 2014 06:38
Terrible hack to close popovers in Angular (using angular-strap)
angular.module('app').directive('rmPopovers',
function($document, $rootScope, $timeout, $popover, $location) {
return {
restrict: 'EA',
link : function(scope, element, attrs, $location) {
var $element = $(element);
function closeAllPopovers(){
$('[popover-block]').each(function(){
var $this = $(this);
@sibsfinx
sibsfinx / deploy.sh
Created July 3, 2014 18:22
build and deploy grunt project
#!/usr/bin/env bash
git branch -D gh-pages
git checkout --orphan gh-pages
git rm -rf .
git clean -fd -e dist
shopt -s dotglob
mv dist/* ./
rmdir dist
git add .
@sibsfinx
sibsfinx / 0_settings.rb
Created June 27, 2014 08:21
how to use *.yml.local settings in Rails
# config/initializers/0_settings.rb
class Settings < Settingslogic
source "#{Rails.root}/config/application.yml"
source "#{Rails.root}/config/application.local.yml"
namespace Rails.env
suppress_errors Rails.env.production?
// http://www.w3schools.com/cssref/css3_pr_appearance.asp
=appearance($a)
appearance: $a
-webkit-appearance: $a
-moz-appearance: $a
select
+appearance(none)
line-height: 1
background: #fff
.map-container,
.menu-container
position: fixed
top: 0
bottom: 0
left: 0
right: 0
// map region
.map-container
$sansFontFamily: 'PT Sans', 'HelveticaNeue', 'Helvetica', Arial, sans-serif
$baseFontFamily: $sansFontFamily
$serifFontFamily: 'PT Serif', 'Georgia', 'Geneva', serif
$headingsFontFamily: $sansFontFamily
$headingsLineHeight: 1.3em
$baseFontSize: 22px
$baseLineHeight: $baseFontSize * 1.6em
@sibsfinx
sibsfinx / isotope.sass
Created December 19, 2013 08:58
sass styles for isotope v1
.isotope-item
z-index: 2
.isotope-hidden.isotope-item
pointer-events: none
z-index: 1
/**** Isotope CSS3 transitions ***
.isotope