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 / inspect_objects.js
Created June 8, 2011 22:28
simple function that allow to inspect js objects =)
/**
* Inspect object in console.log as simple text
* instead of expandable object structure
*
* Usage(e.g.):
* inspectObj(screen);
*
**/
function inspectObj(obj, indentLength) {
@sfate
sfate / onnextsong.sh
Created June 11, 2011 18:54
Mocp onnextsong script
#!/bin/bash
# by Sfate
# $1 artist
# $2 album
# $3 filename
# $4 title
# $5 track
# $6 file duration in XX:YY form
# $7 file duration, number of seconds
@sfate
sfate / amazon_sqs.rb
Created April 21, 2012 13:30
intro Amazon SQS
require 'right_aws'
# aws credits
aws_access_key = {
:id => "your key goes here",
:secret => "your secret access key goes here"
}
# initialize new connection to amazon sqs broker
sqs = RightAws::SqsGen2.new(aws_access_key[:id], aws_access_key[:secret])
@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 / deploy.sh
Last active October 5, 2015 19:27
Colored one line output from git-log
curl http://git.io/git-log-simplify.rb --create-dirs -Lo $HOME/bin/git-lg
chmod +x $HOME/bin/git-lg
@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 "$@"
}