Skip to content

Instantly share code, notes, and snippets.

View dctucker's full-sized avatar
🎹
doing stuff using keyboards

Casey Tucker dctucker

🎹
doing stuff using keyboards
View GitHub Profile
@caffo
caffo / GORILLA.BAS
Created October 31, 2011 03:24
QBasic Gorillas
' Q B a s i c G o r i l l a s
'
' Copyright (C) IBM Corporation 1991
'
' Your mission is to hit your opponent with the exploding banana
@jacobvosmaer
jacobvosmaer / gist:3187346
Created July 27, 2012 10:35
Open all files with git merge conflicts in Vim

Open all files with git merge conflicts in MacVim

git diff --name-only | uniq | xargs mvim

When git encounters a merge conflict, e.g. during a rebase, it drops you back into the shell with a dirty working directory. I like this one-liner for opening all files with a merge conflict in MacVim.

Once you're in Vim, you can then switch between the files with :n and :prev, or another favourite: :w | n (save current file and open the next command line-supplied file).

UPDATE: see below for a version that works with real terminal commands.

@ahendrix
ahendrix / gist:7030300
Created October 17, 2013 18:56
bash stacktrace
function errexit() {
local err=$?
set +o xtrace
local code="${1:-1}"
echo "Error in ${BASH_SOURCE[1]}:${BASH_LINENO[0]}. '${BASH_COMMAND}' exited with status $err"
# Print out the stack trace described by $function_stack
if [ ${#FUNCNAME[@]} -gt 2 ]
then
echo "Call tree:"
for ((i=1;i<${#FUNCNAME[@]}-1;i++))
@bitjockey42
bitjockey42 / 00_OSX_Docker_Machine_Setup.md
Last active November 9, 2020 13:49 — forked from andystanton/Start up local Docker Machine on OSX automatically.md
Use native virtualization on OS X docker with xhyve

What this?

So one of the painful points of using docker on OS X is that you need to run a virtualbox VM, which often suffers from performance issues. With xhyve, a OS X virtualization system, and docker-machine-xhyve you can now have docker use the native OS X hypervisor to run containers.

No more dealing with virtualbox shenanigans!

In this script, I've also set up a way to autoconfigure terminal sessions to load docker's environment vars (dependent on docker-machine) so you do not have to run eval $(docker-machine env whatever) every time you open a new terminal window.

Requirements

@Opencontent
Opencontent / ParensParser.php
Last active June 16, 2020 06:06 — forked from xeoncross/ParensParser.php
PHP: Nested Parenthesis Parser
<?php
// @rodneyrehm
// http://stackoverflow.com/a/7917979/99923
class ParensParser
{
protected $length = null;
// something to keep track of parens nesting
protected $stack = null;
// current level
@quenz
quenz / private.xml
Last active April 23, 2017 00:27 — forked from anonymous/private.xml
Steam Controller Mac key bugs Karabiner workaround
<?xml version="1.0"?>
<root>
<item>
<name>Steam Controller bugs</name>
<item>
<name>Correct Volume Up [from F17]</name>
<identifier>private.steam_controller.change_f17_to_volume_up</identifier>
<device_only>DeviceVendor::RawValue::0x28de, DeviceProduct::RawValue::0x1147</device_only>
<autogen>__KeyToKey__ KeyCode::F17, ConsumerKeyCode::VOLUME_UP</autogen>