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
/** | |
* A more robust 'typeof'. | |
* https://gist.github.com/wizard04wsu/8055356 | |
* | |
* | |
* For each of the type testing methods, the only parameter is the item to be tested. These methods do not perform coercion. | |
* | |
* is(o) - Returns the item's type. | |
* - NaN is considered its own type (instead of a number), since it essentially represents something that cannot be converted to a number. | |
* - For objects, the type of the object is given instead of just 'object' (e.g., 'Array'). |
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
Function getUBound(arr) | |
getUBound = -1 | |
On Error Resume Next | |
getUBound = UBound(arr) | |
On Error GoTo 0 | |
End Function | |
Function getLength(arr) | |
getLength = getUBound(arr) + 1 | |
End Function |
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
//Convert a number to a different base (e.g., from hex to decimal). | |
//Returns a string representation of the number, or NaN if `num` does not represent a number of the specified base. | |
function changeBase(num, fromRadix, toRadix){ | |
if(!(1*fromRadix) || fromRadix%1 !== 0 || fromRadix < 2 || fromRadix > 36){ | |
throw new RangeError(`'fromRadix' must be an integer between 2 and 36, inclusive.`); | |
} | |
if(!(1*toRadix) || toRadix%1 !== 0 || toRadix < 2 || toRadix > 36){ | |
throw new RangeError(`'toRadix' must be an integer between 2 and 36, inclusive.`); | |
} | |
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
//month names, weekday names, and ordinal indicators are in English | |
// Date.now() | |
// Date.fromISOString(isoStr) | |
// Date.timeBetween(date1, date2) | |
// dat.isLeapYear() | |
// dat.isUTCLeapYear() | |
// dat.getDaysInMonth() | |
// dat.getUTCDaysInMonth() | |
// dat.getMonthName() |
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
//getDimensions([elem]) | |
//setScrollPosition(elem, top, left) | |
(function (){ | |
"use strict"; | |
//**********************// | |
//***** Dimensions *****// | |
//**********************// |
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 | |
# 1 | |
wget -qO root.zone http://www.internic.net/domain/root.zone | |
# 2 | |
cat root.zone | grep "IN\sNS" | awk '{print $1}' | uniq | sort | sed -r 's/\.//g' | sed '/^$/d' > zone.list 2> /dev/null | |
# 3 |
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 add either class .peel-br or .peel-tr to your bookmarklet link */ | |
a.peel-br, a.peel-tr { | |
display:inline-block; | |
position:relative; | |
padding:0.4em 0.6em; | |
border:1px solid #B4B4B4; | |
border-radius:5px; | |
background-color:#E6E6E6; | |
color:#333; |
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
.modalMask { | |
display:none; | |
} | |
.modalMask.active { | |
display:block; | |
position:fixed; | |
top:0; | |
left:0; | |
bottom:0; | |
right:0; |
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
//Regular Expressions for U.S. Phone Numbers | |
// | |
//See http://en.wikipedia.org/wiki/North_American_Numbering_Plan | |
// | |
//Spaces, dashes, or periods are allowed as separators. | |
//Extensions can be recognized by several strings: #, x, x., ext, ext., extension | |
// | |
//Area code: $1$2 | |
//Exchange code: $3 | |
//Station code: $4 |
OlderNewer