Skip to content

Instantly share code, notes, and snippets.

@viyatb
viyatb / .bashrc.sh
Last active August 29, 2015 14:06 — forked from yannk/.bashrc.sh
# add in your .bashrc
# http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
# http://blog.cyberion.net/2009/01/improved-bash-prompt-for-git-usage.html
# username@Machine ~/dev/dir[master]$ # clean working directory
# username@Machine ~/dev/dir[master⚡]$ # dirty working directory
#
# I've made the following ajustements:
# - Use of plumbing, that should be faster than git status porcelain.
# - Don't show my repo as dirty if it has files unknown from the index (I always have).
@viyatb
viyatb / lock.sh
Last active August 29, 2015 14:07 — forked from csivanich/lock.sh
#!/bin/bash
# i3lock blurred screen inspired by /u/patopop007 and the blog post
# http://plankenau.com/blog/post-10/gaussianlock
# Timings are on an Intel i7-2630QM @ 2.00GHz
# Dependencies:
# imagemagick
# i3lock
func EncodeStreamingVideo(streamingFile io.Reader, request ShouldCanceler) (*os.File, error) {
outputFilename := generateFilename("mp4")
// Actually start the command.
cmd := exec.Command("ffmpeg",
// Read input from stdin.
"-i", "-",
// ... environment-specific ffmpeg options ...
"-y", outputFilename)
@viyatb
viyatb / frontendDevlopmentBookmarks.md
Last active August 29, 2015 14:25 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.
@viyatb
viyatb / workit.bash
Created October 12, 2015 06:00 — forked from gibatronic/workit.bash
Automatically run workon when entering a directory
function check_for_virtual_env {
[ -d .git ] || git rev-parse --git-dir &> /dev/null
if [ $? == 0 ]; then
local ENV_NAME=`basename \`pwd\``
if [ "${VIRTUAL_ENV##*/}" != $ENV_NAME ] && [ -e $WORKON_HOME/$ENV_NAME/bin/activate ]; then
workon $ENV_NAME && export CD_VIRTUAL_ENV=$ENV_NAME
fi
elif [ $CD_VIRTUAL_ENV ]; then
@viyatb
viyatb / README.md
Created October 22, 2015 06:09
Genymotion scripts

Helper scripts for genymotion and android development

@viyatb
viyatb / Google Domains.txt
Created December 12, 2015 14:41
List of known Google domain names. Useful e.g. for filtering Mint referrers.
# What's this? It's a monster list of Google domain names that have been found to refer
# users to sites that are monitored with Shaun Inman's "Mint" statistics package. http:/haveamint.com/
#
# A huge number of these came from Shawn Blanc's domain list here:
# http://shawnblanc.net/2010/08/cleanup-mint-unique-referrers/
#
# I merged them in to my existing list for this "MONSTAH LIST". Enjoy!
#
# To filter many, many of the Google search results from your "Newest Unique Referrers" results in
# Mint, copy the list below verbatim (don't include these "comment" lines) and paste them into your
@viyatb
viyatb / db.py
Created January 28, 2016 06:50 — forked from carljm/db.py
SQLAlchemy and Postgres autocommit
"""
SQLAlchemy, PostgreSQL (psycopg2), and autocommit
See blog post: http://oddbird.net/2014/06/14/sqlalchemy-postgres-autocommit/
"""
from contextlib import contextmanager
from sqlalchemy import create_engine, event
from sqlalchemy.orm import sessionmaker, Session as BaseSession
@viyatb
viyatb / ss.go
Created May 4, 2016 06:01 — forked from mitchellh/ss.go
// +build windows
package screen
import (
"fmt"
"image"
"reflect"
"syscall"
"unsafe"