Skip to content

Instantly share code, notes, and snippets.


Blaise Kal blaise-io

Block or report user

Report or block blaise-io

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
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();
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.
You can’t perform that action at this time.