Skip to content

Instantly share code, notes, and snippets.

View mark-raymond's full-sized avatar

Mark Raymond mark-raymond

View GitHub Profile
@mark-raymond
mark-raymond / reset-default-branch
Created June 24, 2020 16:40
Script to reset the default branch
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Usage: $0 GITHUB_TOKEN" >&2
exit 1
fi
TOKEN="$1"
ORIGIN="$(git remote get-url origin)"
@mark-raymond
mark-raymond / docker
Created March 11, 2020 10:46
Wrapper for running docker in VMware from git bash
#!/bin/bash
ARGS=("$@")
LASTARG=
for i in "${!ARGS[@]}"; do
ARG="${ARGS[$i]}"
if [ "$LASTARG" = "-v" ] || [ "$LASTARG" = "--volume" ]; then
if grep '^/[a-z]/' <<< "$ARG" > /dev/null; then
ARGS[$i]="$(sed -e 's#^/\([a-z]\)/#/mnt/hgfs/\U\1/#' <<< "$ARG")"
else
#!/usr/bin/env bash
set -e
# names of latest versions of each package
export VERSION_PCRE=pcre-8.36
export VERSION_OPENSSL=openssl-1.0.2a
export VERSION_NGINX=nginx-1.8.0
# URLs to the source directories
@mark-raymond
mark-raymond / delete-event.py
Created January 9, 2015 22:48
delete-event test
#!/usr/bin/python
# -*- coding: utf-8 -*-
import gtk
def delete_handler(menu, event):
with open('log.txt', 'a') as file:
file.write('delete_handler called\n')
return True