This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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 python | |
import argparse | |
import datetime | |
import matplotlib as mpl | |
mpl.use('Agg') | |
import matplotlib.pyplot as plt | |
import numpy | |
import os | |
import re |
This file contains hidden or 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 | |
PORT=50000 | |
TIME=60 | |
print_usage () { | |
echo "Usage: ./iperf.sh [-s|-c destination] [-h] [-p port] [-t time] -k total_packets_per_sec" | |
echo " -h|--help : Print usage." | |
echo " -s : Server mode which receives the data." | |
echo " -c : Client mode which sends the data. Requires destination." |
This file contains hidden or 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 | |
COUNT=450 | |
INTERVAL=2 | |
THRESHOLD=5 | |
print_usage () { | |
echo "Usage: ./ping.sh [-h] [-c count] [-i interval] [-t threshold] -d destination" | |
echo " -h|--help : Print usage." | |
echo " -c|--count : Number of pings to send. Default 450." |
This file contains hidden or 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 | |
# Backup folders to DropBox | |
# Add folder names relative to home directory. | |
# This file exists at the home directory level. | |
DATE=`date +%Y-%m-%d-%H-%M` | |
FOLDERS=("minecraft") | |
DROPBOX="/home/richardhsu/.dropbox/dropbox.py" | |
for dir in "${FOLDERS[@]}" |
This file contains hidden or 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 | |
# Set up a repos.txt file that contains a list of all the repos | |
# one repo per line. Then create an emails.txt file which is where | |
# all the emails will go. It'll be a CSV file so you can verify. | |
# This is a quick hacky way to get emails, not sure if I covered all | |
# valid characters in regex but didn't need precision. Feel free to | |
# make it better! | |
reponame="https://github.com/[a-zA-Z0-9._-]+/([a-zA-Z0-9._-]+)$" | |
email="<([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.\w+)>" |
This file contains hidden or 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 | |
import urllib.request | |
import urllib.parse | |
url = 'http://www.ssa.gov/cgi-bin/namesbystate.cgi' | |
post_data = { | |
'state': 'IL', | |
'year': '2012' | |
} |
This file contains hidden or 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 python | |
import json | |
import urllib, urllib2 | |
# URL and Data to Send | |
url = 'http://localhost/api/table_name' | |
values = { 'user': 'username', | |
'count': 5, | |
'status': False } |
This file contains hidden or 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
// Google Chart Visualization Playground's LineChart Example | |
function drawVisualization() { | |
// Create and populate the data table. | |
var data = google.visualization.arrayToDataTable([ | |
['x', 'Data 1', 'Data 2', 'Data 3'], | |
[1, 1, 1, 0.5], | |
[2, 2, 0.5, 1], | |
[3, 4, 1, 0.5], | |
[4, 8, 0.5, 1], | |
[5, 7, 1, 0.5], |
This file contains hidden or 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 python | |
""" Stack Overflow XML 2 SQL | |
The following is a custom made XML 2 SQL converter for Stack Overflow data. | |
Latest Stack Overflow Data: August 2012 | |
Call Examples: |