Skip to content

Instantly share code, notes, and snippets.

View vijaysharmay's full-sized avatar
💭
I may be slow to respond.

Vijay Yellepeddi vijaysharmay

💭
I may be slow to respond.
View GitHub Profile

Assumes a fresh install of Ubuntu 12.04 LTS.

  1. Setup the system to handle compiling and installing from source.

     $ sudo apt-get install build-essential
    
  2. If SSL support is needed then we will need to install libssl-dev.

     $ sudo apt-get install libssl-dev
    
#!/usr/bin/ruby
require 'rss'
# Usage
# $ ./railscasts.rb http://railscasts.com/subscriptions/YOURRAILSCASTRSS/\/
# episodes.rss
# OR
# $ ./railscasts.rb
p 'Downloading rss index'

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

"""Splay tree
Logan Ingalls <log@plutor.org>
Sept 3, 2012
Note that I only implemented insert and find. Delete is trivial,
and isn't the interesting part of splay trees. Some of these
algorithms would be simpler, but I chose to do this without parent
links from the tree nodes.
Example output on my desktop computer:
@vijaysharmay
vijaysharmay / rateLimitDecorator.py
Created September 25, 2015 07:16 — forked from gregburek/rateLimitDecorator.py
Rate limiting function calls with Python Decorators
import time
def RateLimited(maxPerSecond):
minInterval = 1.0 / float(maxPerSecond)
def decorate(func):
lastTimeCalled = [0.0]
def rateLimitedFunction(*args,**kargs):
elapsed = time.clock() - lastTimeCalled[0]
leftToWait = minInterval - elapsed
if leftToWait>0:
@vijaysharmay
vijaysharmay / bobp-python.md
Created November 9, 2015 09:17 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@vijaysharmay
vijaysharmay / Weighted-majority-experiment.readme
Created November 28, 2015 05:01 — forked from xiaohan2012/Weighted-majority-experiment.readme
Weighted Majority algorithm used in online learning
Three files are included:
1. `weighted_majority.py`: the weighted majority algorithm
2. `main.py`: the main program which takes a specific beta value and make a list of plots
3. `experiment.sh`: bash script that experiments on a list of beta values. This is a good entry of this gist.
@vijaysharmay
vijaysharmay / alphabeta.py
Created November 30, 2015 07:20
Alpha Beta pruning on a Minimax tree in Python
#!/usr/bin/python3
# This can either be run from a command line with python3 alphabeta.py or imported with
# from alphabeta import alphabeta
# USAGE:
# alphabeta(input, start, lower, upper)
#
# Where:
# input is a list form input tree. See example in this file.
@vijaysharmay
vijaysharmay / celery.sh
Created February 28, 2018 13:23 — forked from amatellanes/celery.sh
Celery handy commands
/* Useful celery config.
app = Celery('tasks',
broker='redis://localhost:6379',
backend='redis://localhost:6379')
app.conf.update(
CELERY_TASK_RESULT_EXPIRES=3600,
CELERY_QUEUES=(
Queue('default', routing_key='tasks.#'),