Skip to content

Instantly share code, notes, and snippets.

John Mair banister

Block or report user

Report or block banister

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 screenshot uploader.sh
#!/usr/bin/env bash
CLIENT_ID=<REDACTED>
LOG_FILE=~/.image_uploader.log
touch $LOG_FILE
exec 1>>$LOG_FILE # redirect stdout to the log file
exec 2>&1 # ditto for stderr
View foo.sh
#!/usr/bin/env bash
set -x
CLIENT_ID=<REDACTED>
LOG_FILE=~/.image_uploader.log
touch $LOG_FILE
# folder to watch
SCREENSHOT_FOLDER=/home/user/Pictures/screenshots
View foo.sh
gitwalk() {
git log ${1}..HEAD --oneline | awk '{print $1}' | tac | xargs -I{} -n1 sh -c 'git log -p {}'
}
View omz
main() {
# Use colors, but only if connected to a terminal, and that terminal
# supports them.
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
View oh-my-zsh installer
main() {
# Use colors, but only if connected to a terminal, and that terminal
# supports them.
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
View dev-urandom
jViTBizGANaGywdZaYavwXUBWBuf5qQJVFVBQP6iaURq9veP87jsEBxCwX2ouY10
cWFL2RxOhWhKIkAj6aS8ZTVwliKBeTA2Mwb51mCfsXbUoupWGkmdtTyyVN0i
GQz2naCg+OGmAo8gysw1bIXKvqdTkIqrM1/ybBAKhD1EMFJhalChIYCv8PpD
uS8EFby+z5bTKJ6v/JXmORIylGZeAWLdF1LXGePx8xQCQA8/PlC8qAQJxf0vs0
iK2y2JAtSvcBwB9KGuNjOJ/IFsCSvnpQ92tM/t2vMnTQ9EUyGbse5Dhj7dgL
SCIK2E4RbSa5KFgIGyxBxQV4Y91/gmAE6Cf9WQ4Zo35E6oFQSIH73Xt5TxDouY
1n4yZGbf0Uu5/q5zkkcIV3Hb5UNs8or6iGylnRDiY3PBGSCPnP85roGD7DNp
ssrRXVq0+hgCdxSwN7j3zyTm9vAQ3A9xI0Re7PBXZ8ecXfWqXB1ph9b8oCKS6
tBlyTdFDGlbKcP/6yStHr/zWWDM1pgVr9uEPFBIVz/d+7KCe0oifb6B+8jGd
CTW5VzbtMyw6hImkDROwJ9BmVAjboUutMG0koI_31HKBRaaaaaaaaCmDwSGrQLRw
View gist:51b7bd1a663b91910e7fdb87a3611fc8
#!/bin/sh
set -e
DROPBOX_TOKEN=
DIR=${1:-~}
RUBY_VERSION=2.5.0
# setup logfile (set to append to log)
exec 4>>"$DIR"/basis.log
View gist:4964364f10b416438763e75fbdad4aec
ruby/ruby -v
dyld: lazy symbol binding failed: Symbol not found: _clock_gettime
Referenced from: /foo/bar/ruby (which was built for Mac OS X 10.12)
Expected in: /usr/lib/libSystem.B.dylib
View class.c
static int
include_modules_at(const VALUE klass, VALUE c, VALUE module, int search_super)
{
VALUE p, iclass;
int method_changed = 0, constant_changed = 0;
const st_table *const klass_m_tbl = RCLASS_M_TBL(RCLASS_ORIGIN(klass));
while (module) {
int superclass_seen = FALSE;
You can’t perform that action at this time.