Skip to content

Instantly share code, notes, and snippets.

Working from home

Ankit Goyal goyalankit

Working from home
View GitHub Profile
View redis_pubsub_demo.rb
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
goyalankit / lab.js
Created Jan 20, 2013
javascript for lab page
View lab.js
//To switch directions up/down and left/right just place a "-" in front of the top/left attribute
//Vertical Sliding
$(".cover", this).stop().animate({top:'-260px'},{queue:false,duration:300});
}, function() {
$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:300});
//Horizontal Sliding
goyalankit / labs.css
Last active Dec 11, 2015
css for labs page
View labs.css
/* hosted at: */
*{ padding:0px; margin:0px; }
body{background-image: url("");}
.abox{ color:#C8DCE5; }
h3{ margin: 10px 10px 0 10px; color:#FFF; font:18pt Arial, sans-serif; letter-spacing:-1px; font-weight: bold; }
#letterpress h1 {
color: #BFBFBF;
font: 80px 'LeagueGothicRegular';
text-shadow: 0 2px 3px #A85CBC;
View .vimrc
"janus settings
let g:vroom_use_bundle_exec = 0
set guifont=Monaco:h12
syntax enable
set background=dark
colorscheme solarized
let g:Powerline_symbols = 'fancy'
let g:solarized_termcolors=256
goyalankit / prompt_goyalankit_setup
Last active Dec 18, 2015
Minimalistic Prezto Theme
View prompt_goyalankit_setup
# Author:
# Ankit Goyal <>
# Minimalistic theme with no bullshit
function prompt_goyalankit_setup {
local user_char='%%'
local success_color='%F{071}'
local failure_color='%F{124}'
goyalankit /
Created Jun 20, 2013
Add virtual host in apache linux
###copied from
### Checking for user
if [ "$(whoami)" != 'root' ]; then
echo "You have no permission to run $0 as non-root user. Use sudo !!!"
exit 1;
function keep_only_last_for_n_days_ago(){
echo "function called with $1"
CDIR=`date +%y%m%d -d "$1 day ago"`
for j in `ls -1t "$CDIR"`
count=`expr $count + 1`
View ssh-without-password
# Simple script to ssh without password
# Authour: Ankit Goyal( @_goyalankit)
# TODO replace USERNAME and PASSWORD variables to specify machine.
# chmod +x ssh-without-password
goyalankit / printer-access
Created Aug 30, 2013
check on what public printers you have access at UT Austin Computer Science
View printer-access
# check on what public printers you have access at UT Austin Computer Science
if [ "$1" == "" ];
export def=`eval whoami`
echo "taking default username as $def";