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 replaceUrl(key, newValue) { | |
var url = window.location.href, | |
separator = ~url.indexOf('?') ? '&' : '?', | |
re = new RegExp('([?&])' + key + '=(.*?)([?&]|$)', 'i'), | |
match = re.exec(url), | |
hasParam = !!match; | |
if (hasParam) { | |
if (match[2] === newValue || !newValue) { | |
return url.replace(re, ''); |
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
#!/usr/bin/env bash | |
function check_access () { | |
host=$1; shift | |
port=$1; shift | |
nc -zw 1 $host $port > /dev/null && echo yes || echo no | |
} | |
function set_property () { |
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
{ | |
"name": "web3", | |
"version": "0.0.1", | |
"dependencies": { | |
"bower": { | |
"version": "1.3.5", | |
"from": "bower@1.3.5", | |
"resolved": "https://registry.npmjs.org/bower/-/bower-1.3.5.tgz", | |
"dependencies": { | |
"abbrev": { |
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 isTimeStamp = (function(MAX_INT) { | |
return function(number) { | |
return parseInt(number, 10) > MAX_INT; | |
}; | |
})(Math.pow(2, 31) - 1); |
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 sayHello() { | |
console && console.log('Hello'); | |
} | |
function Person(name, age) { | |
this.name = name; | |
this.age = age; | |
} | |
var aaaa = new Person('aaaa', 12) |
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
public class DBConnector { | |
public GlobalSaver gs = new GlobalSaver(); | |
// ... | |
} | |
public class GlobalSaver { | |
private static DBConnector dbc = new DBConnector(); | |
// ... | |
} |
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 a = []; | |
console.log(a == false); // true | |
console.log(!a == false); // true | |
console.log(!!a == false); // false |
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
... | |
7 44 ms 47 ms 49 ms 30gigabitethernet1-3.core1.ams1.he.net [195.69.145.150] | |
8 56 ms 63 ms 56 ms 10gigabitethernet2-1.core1.par2.he.net [184.105.213.102] | |
9 134 ms 136 ms 137 ms 10gigabitethernet15-1.core1.ash1.he.net [184.105.213.93] | |
10 144 ms 149 ms 150 ms 10gigabitethernet1-2.core1.atl1.he.net [184.105.213.110] | |
11 143 ms 143 ms 143 ms 216.66.0.26 | |
12 * * * Request timed out. | |
13 182 ms 183 ms 185 ms Episode.IV [206.214.251.1] | |
14 182 ms 183 ms 185 ms A.NEW.HOPE [206.214.251.6] | |
15 183 ms 183 ms 183 ms It.is.a.period.of.civil.war [206.214.251.9] |
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 version = '12.34'; | |
version = (function (major, minor) {return major + '.' + (++minor); }).apply(null, version.split('.')); | |
console.log(version); // 12.35 |
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
<html> | |
<head> | |
<script type="text/javascript"> | |
(function (d) { | |
var longTapTimer, | |
ael = 'addEventListener', | |
TAP_DELAY = 500, // ms | |
element = null, | |
onLongTap = function () { |
OlderNewer