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
View gist:aa3a0f334c05984f9cc8b8ba556ef1d0
set -x && mkdir -p /tmp/qpdf && \
curl -sSL https://github.com/qpdf/qpdf/archive/release-qpdf-9.0.0.tar.gz | 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
blaise-io / prepend-use-strict.js
Last active Feb 20, 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();
@blaise-io
blaise-io / script.sh
Last active Jan 25, 2016
Debug cron job in minimal environment
View script.sh
# 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/script.sh
# 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.