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 node | |
// this script looks through chase credit card transactions looking for repeat description/amount combinations | |
// login to Chase, click credit card, set a time range, click download account activity (down arrow), choose CSV | |
// usage: node ./chase-subscription-finder.js Chase*Activity*.CSV | |
const fs = require('fs'); | |
const BLACKLIST = [ | |
'PEETZ', // coffee |
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 zx | |
/** | |
* `npm install -g zx` | |
* | |
* I take photos on a Sony camera in RAW+JPG mode. | |
* I then scroll through all the photos in Darktable usually at least once. | |
* When I really like a photo I export it as DSC001.export.jpg or DSC001.insta.jpg. | |
* Sometimes I rate photos in Darktable but not always. | |
* |
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 cluster = require('cluster'); | |
const http = require('http'); | |
const numCPUs = require('os').cpus().length; | |
if (cluster.isMaster) { | |
console.log(`Master ${process.pid} is running`); | |
// Fork workers. | |
for (let i = 0; i < numCPUs; i++) { | |
cluster.fork(); |
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
/** | |
* This function accepts text which is to be transformed into HTML. When | |
* it encounteres a line which simply contains a single URL it will replace | |
* that URL with an HTML tag to embed the corresponding resource. | |
* | |
* Supported services: | |
* - GitHub Gists | |
* - YouTube Videos | |
* - Vimeo Videos | |
*/ |
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
sudo apt install leafpad htop \ | |
openbox menu openbox-menu tint2 \ | |
obconf lxappearance scrot \ | |
terminator git stterm arandr \ | |
build-essential curl dia dmenu etherape \ | |
filezilla gimp gparted hexcurse \ | |
inkscape nmap tig tmux transmission-gtk \ | |
vim-gtk vlc wireshark zsh keepassx snapd \ | |
feh galculator kazam xbacklight |
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
// parent.js | |
const fork = require('child_process').fork; | |
const CHILDREN = require('os').cpus().length; | |
const pool = []; | |
const OPTS = { | |
stdio: [0, 1, 2, 'ipc'] | |
}; |
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
I included the following block of text, disguised to resemble a PGP sig, at | |
the end of my goodbye work email. It also included information about which | |
internal chat room to post the solution in. The first engineer to reply won | |
the recognition of our coworkers. Can you come up with the answer? | |
-----BEGIN SUPER FUN ENGINEERING CHALLENGE----- | |
IyBTdXBlciBGdW4gRW5naW5lZXJpbmcgQ2hhbGxlbmdlCgpDb25jYXRlbmF0ZSB0aGUgc29sdXRp | |
b24gdG8gZWFjaCBwcm9ibGVtIChzaW1wbGUgQVNDSUkpIGZvciB0aGUgZmluYWwgYW5zd2VyLgpF | |
YWNoIGFuc3dlciB3aWxsIGNvbnNpc3Qgb2YgbnVtYmVycyBhbmQgY2FwaXRhbCBsZXR0ZXJzLgpZ | |
b3Ugd2lsbCBrbm93IGlmIHlvdSBoYXZlIHRoZSBjb3JyZWN0IHN0cmluZyBpZiB0aGUgU0hBMSBz |
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
# Setup Realm's PackageCloud repository | |
curl -s https://packagecloud.io/install/repositories/realm/realm/script.deb.sh | sudo bash | |
# Update the repositories | |
sudo apt-get update | |
# Install the Realm Object Server | |
sudo apt-get install realm-object-server-developer | |
# Enable and start the service |
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
/** | |
* In-Memory Namespaced Key Expiration Cache | |
* | |
* Assumptions: There's a finite amount of namespaces | |
* Data is frequently read | |
* Expirations don't happen frequently | |
* Self-cleaning, doesn't use setTimeout / setImmediate | |
*/ | |
class SimpleCache { | |
constructor() { |
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
/** | |
* Proposing a new rule for no-unused-vars.args | |
* See http://eslint.org/docs/rules/no-unused-vars#args | |
* It would behave similar to after-used, except arguments with `error` sounding names should cause errors if ignored | |
* Configuring this manually with an array would be great | |
*/ | |
/*eslint no-unused-vars: ["error", { "args": "after-used-and-errors", "errors": ["e", "err", "error"] }]*/ | |
asyncWork((err, data) => { // e.g. args: all |
NewerOlder