Skip to content

Instantly share code, notes, and snippets.

View amberj's full-sized avatar

Amber Jain amberj

View GitHub Profile
@amberj
amberj / setup-local-replit.sh
Created March 14, 2013 23:30
A bash script to automate the installation/setup of repl.it on local system.
#!/bin/bash
#
## @file setup-local-replit.sh
## @author Amber Jain
## @section DESCRIPTION A bash script to automate the installation/setup of repl.it on local system
## @section LICENSE ISC
#################
# Documentation #
@amberj
amberj / rgb-colored-echo.sh
Last active April 25, 2024 21:45
A bash pretty print script that provides following red/green/blue colored echo functions.
#!/bin/bash
#
## @file rgb-colored-echo.sh
## @author Amber Jain
## @section DESCRIPTION A bash pretty print script which provides red/green/blue colored echo functions
## @section LICENSE ISC
#################
# Documentation #
@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
@amberj
amberj / rev-youtube-playlist-urls.sh
Created May 7, 2012 23:52
This (bash) script takes a youtube playlist URL as argument and outputs title and URL of each video (in playlist) in reverse order
#!/bin/bash
#
# File: rev-youtube-playlist-urls.sh
# Description: This (bash) script takes a youtube playlist URL as argument and outputs title and URL of each video (in playlist) in reverse order (i.e. starting from last video in playlist)
# Author: Amber Jain
# Check if "only one" argument (playlist_url) passed as input:
if [ "$#" -lt "1" ]
then
echo "Invalid! You must pass playlist_url as argument"
@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/