To run this, you can try:
curl -ksO https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh
chmod +x ./uninstall-node.sh
./uninstall-node.sh
rm uninstall-node.sh
// checksum calculation for GTIN-8, GTIN-12, GTIN-13, GTIN-14, and SSCC | |
// based on http://www.gs1.org/barcodes/support/check_digit_calculator | |
function isValidBarcode(barcode) { | |
// check length | |
if (barcode.length < 8 || barcode.length > 18 || | |
(barcode.length != 8 && barcode.length != 12 && | |
barcode.length != 13 && barcode.length != 14 && | |
barcode.length != 18)) { | |
return false; | |
} |
var runInSandbox = (function () { | |
function extend(dest, src, arr) { | |
var property = null, | |
ext = '', | |
isArray = false, | |
key; | |
for (property in src) { | |
key = arr ? '[' + property + ']' : '["' + property + '"]'; | |
ext += dest + key + ' = '; |
To run this, you can try:
curl -ksO https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh
chmod +x ./uninstall-node.sh
./uninstall-node.sh
rm uninstall-node.sh
i386 : iPhone Simulator | |
x86_64 : iPhone Simulator | |
arm64 : iPhone Simulator | |
iPhone1,1 : iPhone | |
iPhone1,2 : iPhone 3G | |
iPhone2,1 : iPhone 3GS | |
iPhone3,1 : iPhone 4 | |
iPhone3,2 : iPhone 4 GSM Rev A | |
iPhone3,3 : iPhone 4 CDMA | |
iPhone4,1 : iPhone 4S |
<select name="timezone_offset" id="timezone-offset" class="span5"> | |
<option value="-12:00">(GMT -12:00) Eniwetok, Kwajalein</option> | |
<option value="-11:00">(GMT -11:00) Midway Island, Samoa</option> | |
<option value="-10:00">(GMT -10:00) Hawaii</option> | |
<option value="-09:50">(GMT -9:30) Taiohae</option> | |
<option value="-09:00">(GMT -9:00) Alaska</option> | |
<option value="-08:00">(GMT -8:00) Pacific Time (US & Canada)</option> | |
<option value="-07:00">(GMT -7:00) Mountain Time (US & Canada)</option> | |
<option value="-06:00">(GMT -6:00) Central Time (US & Canada), Mexico City</option> | |
<option value="-05:00">(GMT -5:00) Eastern Time (US & Canada), Bogota, Lima</option> |
/** | |
* Works everywere ( IE7+, FF, Chrome, Safari, Opera ) | |
* Example: http://jsbin.com/afAQAWA/2/ | |
*/ | |
.rotated-text { | |
display: inline-block; | |
overflow: hidden; | |
width: 1.5em; | |
} | |
.rotated-text__inner { |
This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.
I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.
Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.
// Date Object CheatSheet | |
// The Date object is used to work with dates and times. | |
// More: http://www.w3schools.com/jsref/jsref_obj_date.asp | |
// 1. Instantiating a Date. | |
var date = new Date(); | |
var date = new Date(milliseconds); |
/** | |
* Get path data for a rounded rectangle. Allows for different radius on each corner. | |
* @param {Number} w Width of rounded rectangle | |
* @param {Number} h Height of rounded rectangle | |
* @param {Number} tlr Top left corner radius | |
* @param {Number} trr Top right corner radius | |
* @param {Number} brr Bottom right corner radius | |
* @param {Number} blr Bottom left corner radius | |
* @return {String} Rounded rectangle SVG path data | |
*/ |
var a = ["sdfdf", "http://oooooolol"], | |
handleNetErr = function(e) { return e }; | |
Promise.all(fetch('sdfdsf').catch(handleNetErr), fetch('http://invalidurl').catch(handleNetErr)) | |
.then(function(sdf, invalid) { | |
console.log(sdf, invalid) // [Response, TypeError] | |
}) | |
.catch(function(err) { | |
console.log(err); | |
}) |