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
// returns false unless valid | |
function validateEmail(email) | |
{ | |
var re = /\S+@\S+\.\S+/; | |
return re.test(email); | |
} |
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
var hash = window.location.hash; | |
if (hash == "#hashish" || pathArray[0] == "#hashish") { | |
// do stuff | |
} |
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
$ wget \ | |
--recursive \ | |
--no-clobber \ | |
--page-requisites \ | |
--html-extension \ | |
--convert-links \ | |
--domains example.us \ | |
--no-parent \ | |
example.us |
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
/** | |
* Nicely format large numbers to make them readable: | |
* Billions to one decimal like "$1.3 billion" | |
* Millions to nearest million like "$346 million" | |
* Thousands to nearest thousand like "$144,000" | |
* @param {number} The number to format | |
* @returns {string} Readable string with dollar sign and amount | |
*/ | |
function niceBigNumber(num) { | |
// format billions to one decimal like "$1.3 billion" |
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
// just a slimmed-down implementation of browser testing for IE in JavaScript | |
// based on code I found online | |
/** | |
* detect IE | |
* returns version of IE or false, if browser is not Internet Explorer | |
*/ | |
function detectIE() { | |
var ua = window.navigator.userAgent; | |
var msie = ua.indexOf('MSIE '); | |
if (msie > 0) { |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# all thanks to nael shiab's post here: http://naelshiab.com/tutorial-send-email-python | |
# adding gist for my own reference / ease remembering | |
import smtplib | |
from_email = "########@gmail.com" | |
from_email_password = "somethingsecure" | |
to_email = "#######@some_email.com" | |
server = smtplib.SMTP('smtp.gmail.com', 587) |
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
python -m json.tool my_json.json > my_pretty_json.json |