Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View waterlink's full-sized avatar

Alex Fedorov waterlink

View GitHub Profile
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */
@waterlink
waterlink / git-workflow.sh
Last active December 26, 2015 14:39
my git workflow
#!/bin/bash
alias gf="git fetch"
function gwco {
number="$1"
# all branches | get origin/number_* | remove remotes/ | remove origin/ | 1st line| strip
branch=$(git branch -a | grep -F "origin/${number}_" | sed 's/remotes\///' | sed 's/origin\///' | head -1 | awk '{print $1}')
git checkout "${branch}"
}
@waterlink
waterlink / lxc-centos
Created November 24, 2013 16:26
working lxc-centos template for ubuntu 12.04 lts
#!/bin/bash
#
# template script for generating CentOS container for LXC
#
#
# lxc: linux Container library
# Authors:
#!/bin/bash
export PATH="$HOME/projects/dockey/bin:$PATH"
export LXC_PATH="/var/lib/lxc/"
export LXC_PREFIX="/home/user/projects/lxc/src/lxc/"
function _base {
if [[ "$1" = "install" ]]; then
[[ -x "$LXC_PATH/$DOCKEY_NAME" ]] || dockey create
dockey start
@waterlink
waterlink / cluster-9.3.init.sh
Created December 3, 2013 14:59
Initializing pg 9.3 cluster
LANG=en_US.UTF-8 service postgresql-9.3 initdb en_US.UTF-8
apt-get -qq -y --force-yes install gcc libpcre++-dev libcurl4-openssl-dev libxml2-dev libjpeg-dev libpng-dev libxpm-dev libfreetype6-dev libmcrypt-dev libmysql++-dev autoconf libevent-dev libltdl-dev
@waterlink
waterlink / readme.sh
Last active December 30, 2015 18:59 — forked from liamdon/gist:2467603
Coffee + Jade for Sublime
### Step 1: Clone the bundles into your Sublime Text packages directory
cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages
git clone git://github.com/jashkenas/coffee-script-tmbundle CoffeeScript
git clone https://github.com/miksago/jade-tmbundle.git Jade
git clone https://github.com/LearnBoost/stylus.git Stylus
### Step 2: Restart Sublime Text 2
@waterlink
waterlink / down.sh
Created January 8, 2014 15:55
emulate increased latency and decreased rate
#!/bin/bash
sudo tc qdisc add dev eth0 root tbf rate 128kbit latency 500ms burst 2000
@waterlink
waterlink / application.scss
Created March 12, 2014 22:22
Accordion without js
@mixin transition($x) {
transition: #{$x};
-o-transition: #{$x};
-moz-transition: #{$x};
-webkit-transition: #{$x};
}
ul.tabs {
list-style: none;
@waterlink
waterlink / devise.rb
Created March 16, 2014 15:19
Rspec Devise helper with support for routing :authenticated and :unauthenticated tests
# spec/support/devise.rb
module Devise::RoutingTestHelpers
attr_accessor :request
def initialize(*args)
@request ||= Hashie::Mash.new env: {}
super(*args)
end