Skip to content

Instantly share code, notes, and snippets.


Blaise Kal blaise-io

View GitHub Profile
View Overwrite SSH identity and author
# Overwrite GIT_AUTHOR_EMAIL so the commits are attributed to you
# -i /path/to/other/id_rsa: use a non-default identity file
# -o IdentitiesOnly=yes: ignore identities in the ssh agent
# -F /dev/null: ignore .ssh/config
GIT_SSH_COMMAND="ssh -i /path/to/other/id_rsa -o IdentitiesOnly=yes -F /dev/null"
View gist:aa3a0f334c05984f9cc8b8ba556ef1d0
set -x && mkdir -p /tmp/qpdf && \
curl -sSL | tar xz --strip 1 -C /tmp/qpdf && \
echo "Grab a coffee, this will take a while..." && (cd /tmp/qpdf && /tmp/qpdf/configure && make) && \
mv /tmp/qpdf/qpdf/build/qpdf /usr/local/bin && \
rm -rf /tmp/* && set +x && qpdf --version
blaise-io /
Last active Jan 25, 2016
Debug cron job in minimal environment
# Sometimes cron jobs don't execute properly. It's hard to debug because
# the job may execute just fine if you run it manually in your shell.
# That's because cron jobs run in a minimal shell by default.
# This will run the script in a minimal environment:
env - /path/to/
# Spoiler alert: Usually, the solution is to define the shell in the script,
# by prepending #!/bin/bash.
blaise-io / prepend-use-strict.js
Last active Sep 29, 2019
Prepend all JavaScript files with "use strict"; that don't have it yet
View prepend-use-strict.js
// To run:
// npm install globby
// node prepend-use-strict.js
var globby = require('globby');
var fs = require('fs');
globby('**/*.js', function(err, files) {
for (var i = 0, m = files.length; i < m; i++) {
var fileContent = fs.readFileSync(files[i]).toString();
You can’t perform that action at this time.