Skip to content

Instantly share code, notes, and snippets.

View sfate's full-sized avatar
🇺🇦
Glory to Ukraine, Glory to the Nation, fuck the russian federation! :feelsgood:

Oleksii Bobyriev sfate

🇺🇦
Glory to Ukraine, Glory to the Nation, fuck the russian federation! :feelsgood:
View GitHub Profile
@sfate
sfate / gitbox.sh
Created June 1, 2012 11:02 — forked from aslakhellesoy/gitbox.sh
Set up a git remote in your DropBox Public folder
#!/bin/bash
# Call this script from a local git repo to set up a dropbox remote you can push and pull to
# I keep this script under ~/Dropbox/Public/.git/gitbox.sh
# Inspired from http://stackoverflow.com/questions/1960799/using-gitdropbox-together-effectively
PROJECT=$(basename `pwd`)
DROPBOX="$HOME/Dropbox/Public"
mkdir -p $DROPBOX/.git
pushd $DROPBOX/.git
@sfate
sfate / vim-on-heroku.sh
Created June 7, 2012 14:39 — forked from naaman/vim-on-heroku.sh
vim on heroku
#!/usr/bin/env bash
curl https://s3.amazonaws.com/heroku-jvm-buildpack-vi/vim-7.3.tar.gz --output vim.tar.gz
mkdir vim && tar xzvf vim.tar.gz -C vim
export PATH=$PATH:/app/vim/bin
require 'haml'
require 'haml/html'
require 'httparty'
module Jekyll
class SyntaxBlock < Liquid::Block
def initialize(tag_name, language, tokens)
super
@language = language
end
@sfate
sfate / gist:2991586
Created June 25, 2012 21:56 — forked from tapajos/gist:1433859
No more 'bundle exec'
# Add this lines into your .bashrc
function rake {
bundle_exec 'rake' $@
}
function rspec {
bundle_exec 'rspec' $@
}
@sfate
sfate / where_is.rb
Created July 4, 2012 14:37 — forked from wtaysom/where_is.rb
A little Ruby module for finding the source location where class and methods are defined.
module Where
class <<self
attr_accessor :editor
def is_proc(proc)
source_location(proc)
end
def is_method(klass, method_name)
source_location(klass.method(method_name))
@sfate
sfate / aliases.sh
Created July 11, 2012 15:04 — forked from indirect/aliases.sh
Make and cd into a directory
# make and cd to a directory
function mcd {
mkdir -p "$@"
cd "$@"
}
@sfate
sfate / rc.sh
Created July 11, 2012 15:09 — forked from indirect/rc.sh
rails console alias for both 2 and 3
# Rails 2 and Rails 3 console
function rc {
if [ -e "./config/environment.rb" ]; then
irb -Iconfig -renvironment
else
echo -e "\e[1;31m Error: \e[0mNo rails environment was founded! \n"
fi
}
@sfate
sfate / init_rails3_app.sh
Created July 11, 2012 15:10 — forked from indirect/steps.sh
creating an edge rails3 app with RVM
rvm use @global
gem i bundler
mkdir my_app && cd my_app
rvm --create --rvmrc @my_app
bundle init
echo "gem 'rails', :github => 'rails/rails'" >> Gemfile
bundle
bundle exec rails new .
bundle exec rails server
@sfate
sfate / hamlhtml5boilerplate.html.haml
Created August 27, 2012 12:16 — forked from neiled/hamlhtml5boilerplate.html.haml
My haml version of the html 5 boiler plate code
!!! 5
/[if lt IE 7] <html lang="en" class="no-js ie6">
/[if IE 7 ] <html lang="en" class="no-js ie7">
/[if IE 8 ] <html lang="en" class="no-js ie8">
/[if IE 9 ] <html lang="en" class="no-js ie9">
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
%head
%meta{:charset => "utf-8"}/
/
Always force latest IE rendering engine (even in intranet) &amp; Chrome Frame
@sfate
sfate / uri.js
Created September 6, 2012 09:41 — forked from nhocki/uri.js
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"