View process_count.sh
#!/bin/bash | |
while(true) | |
do | |
echo `date`, `ps -Al | wc -l 2>&1`, `lsof -u jenkins | wc -l 2>&1` | tee -a ./process_count.log | |
sleep 1 | |
done |
View gist:2e363d8b3c64be823289a84e5cfe6489
nc -l -p 9000 -c "nc 127.0.0.1 10353" | |
// "forward" 10353 to 9000 so it can be accessed externally |
View gist:13353a416a3b0cde5cacf98bfe30680d
nc -zv hostname port |
View setupMocha.js
// Used to run mocha tests within intellij. Provide "--require setupMocha" to mocha to use this | |
require("babel/register"); | |
var chai = require("chai"); | |
var sinonChai = require("sinon-chai"); | |
var jsdom = require("jsdom").jsdom; | |
global.document = jsdom(""); | |
global.window = document.defaultView; | |
Object.keys(document.defaultView).forEach((property) => { | |
if (typeof global[property] === "undefined") { |
View example.sh
# Record Simulator screen - CTRL+C to finish | |
xcrun simctl io booted recordVideo appVideo.mov | |
# Optionally, convert to gif to attach to a GitHub PR: | |
# install dependencies | |
brew install ffmpeg -- --with-fdk-aac --with-ffplay --with-freetype --with-libass --with-libquvi --with-libvorbis --with-libvpx --with-opus --with-x265 | |
brew install imagemagick | |
# convert .mov to a series of PNGs |
View prettify_detox.js
if (process.argv.length !== 3) { | |
console.error("Expects exactly one argument"); | |
return; | |
} | |
const path = process.argv[2]; | |
console.log(path + "\n"); | |
const lineReader = require('readline').createInterface({ | |
input: require('fs').createReadStream(path) | |
}); |
View sainsbury-receipt.js
// node <this file.js> <sainsbury json receipt> | |
const fs = require("fs"); | |
const file = process.argv[2]; | |
const data = JSON.parse(fs.readFileSync(file, { encoding: "utf8", flag: "r" })); | |
console.log("name,qty,total"); | |
data.order_items.map(item => { | |
const name = item.product.name.replace(",", ""); |