Skip to content

Instantly share code, notes, and snippets.

View joshterrill's full-sized avatar

Josh Terrill joshterrill

View GitHub Profile
@joshterrill
joshterrill / US Zip Codes from 2013 Government Data
Created November 15, 2017 23:57 — forked from erichurst/US Zip Codes from 2013 Government Data
All US zip codes with their corresponding latitude and longitude coordinates. Comma delimited for your database goodness. Source: http://www.census.gov/geo/maps-data/data/gazetteer.html
This file has been truncated, but you can view the full file.
ZIP,LAT,LNG
00601,18.180555, -66.749961
00602,18.361945, -67.175597
00603,18.455183, -67.119887
00606,18.158345, -66.932911
00610,18.295366, -67.125135
00612,18.402253, -66.711397
00616,18.420412, -66.671979
00617,18.445147, -66.559696
00622,17.991245, -67.153993
{
"assets": [
{
"id": "image_0",
"w": 8000,
"h": 1467,
"u": "images/",
"p": "img_0.png"
},
{
@joshterrill
joshterrill / Payroll.sol
Last active April 30, 2018 12:36
Payroll solidity contract example
contract Payroll {
// define variables
address public CompanyOwner;
uint employeeId;
// create Employee object
struct Employee {
uint employeeId;
address employeeAddress;
@joshterrill
joshterrill / balance.sol
Last active August 19, 2016 01:36
30 days of Solidity - Day 1: Balance contract
contract Balance {
uint public balance;
}

Keybase proof

I hereby claim:

  • I am joshterrill on github.
  • I am joshterrill (https://keybase.io/joshterrill) on keybase.
  • I have a public key whose fingerprint is 25FA 836A E958 18A3 EF6A E79F B3B3 908C 7ED7 608F

To claim this, I am signing this object:

@joshterrill
joshterrill / valid-file-name.js
Created June 30, 2015 22:11
valid filename regex
var str = '// \\ / \ _ - . ( ) () &&& !@#$%^&*)*_+=this is a test #$^*#<><>[][]{}{}{}{)(*#@';
var result = str.replace(/_|#|\\|\/|-|\.|\ |\(|\)|\&|\@|\!|\$|\%|\^|\*|\+|\=|\[|\]|\{|\}|\'|\"|\<|\>|\?|/g,'');
console.log(result);
// thisisatest
@joshterrill
joshterrill / mailer.sh
Created June 17, 2015 10:35
Bash log mailer
# sendmail -t "[email protected]" < mail.txt
# To: [email protected]
# From: jobs@pig-1-102828
# Subject: Sent from a terminal!
# Thanks for the message!
DATE=`date +%d-%m-%y`
ps aux > /var/www/html/mailerlog/$DATE.txt
sendmail -t "[email protected]" < /var/www/html/mailerlog/$DATE.txt
@joshterrill
joshterrill / datepickerNoFocus.js
Last active August 29, 2015 14:16
code that allows the datepicker() to focus first without showing the calendar UI until input field is clicked
function cwUtil_focusDateInput(name) {
var selectedInput = $("[name='" + name + "']");
$(selectedInput).focus();
$(selectedInput).on("click", function() {
$(this).datepicker();
$(this).focus();
});
}
@joshterrill
joshterrill / tweet.js
Created August 8, 2014 22:22
tweet.js example for phantom js
// Get twitter status for given account (or for the default one, "PhantomJS")
var page = require('webpage').create(),
system = require('system'),
twitterId = "PhantomJS"; //< default value
// Route "console.log()" calls from within the Page context to the main Phantom context (i.e. current "this")
page.onConsoleMessage = function(msg) {
console.log(msg);
};
@joshterrill
joshterrill / ip_list.txt
Last active August 29, 2015 14:02
a small bash script that loops through all of the ip's in a file and blocks them using iptables
1.1.1.1
2.2.2.2
3.3.3.3