Skip to content

Instantly share code, notes, and snippets.

View goyalankit's full-sized avatar
🏠
Working from home

Ankit Goyal goyalankit

🏠
Working from home
View GitHub Profile
# 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 January 20, 2013 07:39
javascript for lab page
$(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 December 11, 2015 08:59
css for labs page
/* 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;
"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 December 18, 2015 14:49
Minimalistic Prezto Theme
#
# Author:
# Ankit Goyal <[email protected]>
#
# 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 June 20, 2013 11:05
Add virtual host in apache linux
#!/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
#!/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`
#!/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
require 'pry'
IRB=pry
@goyalankit
goyalankit / printer-access
Created August 30, 2013 19:22
check on what public printers you have access at UT Austin Computer Science
#!/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";