This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ABOUT: | |
# | |
# Use this set of commands to: | |
# - Change password of root account | |
# - Create a new user account, set it's password and grant sudo privileges | |
# on Ubuntu Linux. | |
# Change password of currently logged in 'root' account: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"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", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
principal = 200000 | |
# Annual rate of interest | |
# e.g. 9.25% | |
r = 9.25 | |
# number of compounding periods per year | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
monthly_installment = 30000 | |
# 36 means one installment every month for 3 years | |
number_of_installments = 36 | |
# Annual rate of interest | |
# e.g. 9.25% | |
r = 9.25 |
OlderNewer