Name | Version | License | URL |
---|---|---|---|
align-text | 0.1.4 | MIT | git://github.com/jonschlinkert/align-text.git |
amdefine | 1.0.0 | BSD-3-Clause AND MIT | https://github.com/jrburke/amdefine.git |
async | 1.5.2 | MIT | https://github.com/caolan/async.git |
async | 0.2.10 | MIT | https://github.com/caolan/async.git |
balanced-match | 0.4.2 | MIT | git://github.com/juliangruber/balanced-match.git |
brace-expansion | 1.1.6 | MIT | git://github.com/juliangruber/brace-expansion.git |
camelcase | 1.2.1 | MIT |
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 | |
wget -q --spider http://google.com | |
if [ $? -eq 0 ]; then | |
echo "Online" | |
else | |
echo "Offline" | |
fi |
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
// put it on top of the file, not in a describe block | |
// it delays protractor actions by 100ms so you can see | |
// what's happening | |
var origFn = browser.driver.controlFlow().execute; | |
browser.driver.controlFlow().execute = function() { | |
var args = arguments; | |
// queue 100ms wait | |
origFn.call(browser.driver.controlFlow(), 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
#!/usr/local/bin/bash | |
# Instructions: Rename .git/hooks/prepare-commit-msg.sample to | |
# .git/hooks/prepare-commit-msg and add the contents of this file. | |
# Make the file executable by typing "chmod u+x .git/hooks/prepare-commit-msg" | |
# This way you can customize which branches should be skipped when | |
# prepending commit message. | |
if [ -z "$BRANCHES_TO_SKIP" ]; then | |
BRANCHES_TO_SKIP=(master develop test) |
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
// Replace $window with any other injected service | |
var win = angular.element(document.querySelector('html')).injector().get('$window'); | |
// Or access the scope over a DOM element (fix .the-css-class and ctrlName. Maybe $parent is not needed either | |
var a = angular.element('.the-css-class').scope().$parent.ctrlName; |
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 | |
for file in $(git diff --diff-filter=d --cached --name-only | grep -E '\.js$') | |
do | |
git show ":$file" | node_modules/.bin/eslint --stdin --stdin-filename "$file" # we only want to lint the staged changes, not any un-staged changes | |
if [ $? -ne 0 ]; then | |
echo "ESLint failed on staged file '$file'. Please check your code and try again." | |
exit 1 # exit with failure status | |
fi | |
done |
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
const dgram = require('dgram'); | |
const raw = require('raw-socket'); | |
const dns = require('dns-then'); | |
const icmpSocket = raw.createSocket({ protocol: raw.Protocol.ICMP }); | |
const udpSocket = dgram.createSocket('udp4'); |
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 sendPacket() { | |
port++; | |
if (tries >= 3) { | |
tries = 0; | |
ttl++; | |
} | |
tries++; | |
udpSocket.setTTL(ttl); |
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
icmpSocket.on('message', async function (buffer, ip) { | |
let p = buffer.toString('hex').substr(100, 4); | |
let portNumber = parseInt(p, 16); | |
if (port === portNumber) { | |
try { | |
let symbolicAddress; | |
if (!NO_REVERSE_LOOKUP) { | |
symbolicAddress = await getSymbolicAddress(ip); | |
} | |
handleReply(ip, symbolicAddress)[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
function handleReply(ip, symbolicAddress) { | |
if (timeout) { | |
clearTimeout(timeout); | |
} | |
if (ip) { | |
const elapsedTime = `${(process.hrtime(startTime)[1] / 1000000).toFixed(3)} ms`; | |
if (ip === previousIP) { | |
process.stdout.write(` ${elapsedTime}`); |
OlderNewer