Skip to content

Instantly share code, notes, and snippets.

View anchoo2kewl's full-sized avatar

Anshuman Biswas anchoo2kewl

View GitHub Profile
@anchoo2kewl
anchoo2kewl / deploy.sh
Last active August 29, 2015 14:01
This is used to merge one branch with several other branches
#/bin/bash
# chkconfig: 2345 50 70
SUCCESS=0
FAILURE=1
#
if [ $# -lt 2 ]
then
echo "Usage: deploy.sh mergeFromBranch {ListOFmergeToBranches}"
exit $FAILURE
fi
@anchoo2kewl
anchoo2kewl / tandem.c
Created April 21, 2014 17:15
'k' M/M/1 tandem queue simulation
//******************************************************************************
//* 'k' M/M/1 tandem queue simulation *
//******************************************************************************
//* Notes: *
//*----------------------------------------------------------------------------*
//* Build: gcc -o tandem tandem.c *
//*----------------------------------------------------------------------------*
//* Execute: ./tandem MAX_CUSTOMERS NUM_SERVERS(k) INTER_ARR_TIME1 *
//* SERV_TIME1 PROBABILITY1 .. INTER_ARR_TIME(k) SERV_TIME(k) PROBABILITY(k) *
//*----------------------------------------------------------------------------*
@anchoo2kewl
anchoo2kewl / mm1.c
Created April 21, 2014 17:14
A simple M/M/1 queue simulation
//******************************************************************************
//* A simple M/M/1 queue simulation *
//******************************************************************************
//* Notes: 1. This program requires parameters for Inter Arrival time, *
//** Service time as well as maximum number of customers *
//*----------------------------------------------------------------------------*
//* Build: gcc -o mm1 mm1.c *
//*----------------------------------------------------------------------------*
//* Execute: ./mm1 MAX_CUSTOMERS ARR_TIME SERV_TIME *
//*----------------------------------------------------------------------------*
@anchoo2kewl
anchoo2kewl / responsive-video
Created May 19, 2013 15:27
Just include this code on a page with videos and see them "magically" become responsive.
var $allVideos = $("iframe[src^='http://player.vimeo.com'],iframe[src^='http://www.youtube.com']");
var $fluidEl = $("figure");
$allVideos.each(function() {
$(this)
// jQuery .data does not work on object/embed elements
.attr('data-aspectRatio', this.height / this.width)
.removeAttr('height')
.removeAttr('width');
});