Skip to content

Instantly share code, notes, and snippets.

View amberj's full-sized avatar

Amber Jain amberj

View GitHub Profile
@amberj
amberj / fizzbuzz.py
Created April 5, 2012 22:34
FizzBuzz
# fizzbuzz.py
# Python implementation of FizzBuzz (http://imranontech.com/2007/01/24/using-fizzbuzz-to-find-developers-who-grok-coding/)
#
# Author: Amber Jain (http://amberj.devio.us/)
# Problem description:
# Write a program that prints the numbers from 1 to 100.
# But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz".
# For numbers which are multiples of both three and five print "FizzBuzz".
# Problem source: http://imranontech.com/2007/01/24/using-fizzbuzz-to-find-developers-who-grok-coding/
@amberj
amberj / setup-headless-selenium-xvfb.sh
Created September 25, 2013 05:06
Bash script to install/setup headless Selenium (uses Xvfb and Chrome)
#!/bin/bash
#
# Bash script to setup headless Selenium (uses Xvfb and Chrome)
# (Tested on Ubuntu 12.04)
# Add Google Chrome's repo to sources.list
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list
# Install Google's public key used for signing packages (e.g. Chrome)
# (Source: http://www.google.com/linuxrepositories/)
{"shop_id":84644,
"vendor_id":62414,
"img_URL":null,
"user_preferred_domain":null,
"shipping_cost":0,
"shop_description":"my test shop",
"domain_identifier":"test59",
"shop_name":"Test",
"shop_logo_URL":null,
"shop_contact_number":"9769110914",
@amberj
amberj / latency.txt
Created June 8, 2012 18:22 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD* 150,000 ns 0.15 ms