Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
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
goyalankit / lab.js
Created Jan 20, 2013
javascript for lab page
View lab.js
$(document).ready(function(){
//To switch directions up/down and left/right just place a "-" in front of the top/left attribute
//Vertical Sliding
$('.boxgrid.slidedown').hover(function(){
$(".cover", this).stop().animate({top:'-260px'},{queue:false,duration:300});
}, function() {
$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:300});
});
//Horizontal Sliding
$('.boxgrid.slideright').hover(function(){
@goyalankit
goyalankit / labs.css
Last active Dec 11, 2015
css for labs page
View labs.css
/* hosted at: http://static.tumblr.com/nic27se/ZUnmgxct7/labs.css */
*{ padding:0px; margin:0px; }
body{background-image: url("http://static.tumblr.com/nic27se/R7cmha6wl/back.jpg");}
.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
goyalankit / prompt_goyalankit_setup
Last active Dec 18, 2015
Minimalistic Prezto Theme
View prompt_goyalankit_setup
#
# Author:
# Ankit Goyal <ankit3goyal@gmail.com>
#
# Minimalistic theme with no bullshit
function prompt_goyalankit_setup {
local user_char='%%'
local success_color='%F{071}'
local failure_color='%F{124}'
@goyalankit
goyalankit / add-v-host.sh
Created Jun 20, 2013
Add virtual host in apache linux
View add-v-host.sh
#!/bin/bash
###copied from http://www.chaugule.in/linux/shell-script-adding-virtual-hosts-ubuntu-apache/
### Checking for user
if [ "$(whoami)" != 'root' ]; then
echo "You have no permission to run $0 as non-root user. Use sudo !!!"
exit 1;
fi
View remove_old_backup.sh
#!/bin/sh
function keep_only_last_for_n_days_ago(){
echo "function called with $1"
CDIR=`date +%y%m%d -d "$1 day ago"`
count=0
for j in `ls -1t "$CDIR"`
do
count=`expr $count + 1`
View ssh-without-password
#!/usr/bin/expect
#
# Simple script to ssh without password
# Authour: Ankit Goyal( @_goyalankit)
#
# TODO replace USERNAME and PASSWORD variables to specify machine.
#
# USAGE:
# chmod +x ssh-without-password
@goyalankit
goyalankit / printer-access
Created Aug 30, 2013
check on what public printers you have access at UT Austin Computer Science
View printer-access
#!/bin/bash
#
# check on what public printers you have access at UT Austin Computer Science
#
if [ "$1" == "" ];
then
export def=`eval whoami`
echo "taking default username as $def";