Skip to content

Instantly share code, notes, and snippets.

View ChristianBagley's full-sized avatar

Christian Bagley ChristianBagley

View GitHub Profile
@ChristianBagley
ChristianBagley / 0_reuse_code.js
Last active August 29, 2015 14:09
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ChristianBagley
ChristianBagley / rp5.bsh
Last active August 29, 2015 14:15 — forked from monkstone/rp5.bsh
/**
* rp5.bsh by monkstone 18 December 2013
* A jedit bean shell macro, to load environment, and call
* rp5 commando menu
*
* You must edit JAVA_HOME/GEM_HOME/GEM_PATH to match your system
*
*/
setenv("JAVA_HOME", "/opt/jdk1.8.0");
setenv("GEM_HOME", "/home/tux/.gem/ruby/2.0.0");
# Short of learning how to actually configure OSX, here's a hacky way to use
# GNU manpages for programs that are GNU ones, and fallback to OSX manpages otherwise
alias man='_() { echo $1; man -M $(brew --prefix)/opt/coreutils/libexec/gnuman $1 1>/dev/null 2>&1; if [ "$?" -eq 0 ]; then man -M $(brew --prefix)/opt/coreutils/libexec/gnuman $1; else man $1; fi }; _'
@ChristianBagley
ChristianBagley / osx-for-hackers.sh
Last active August 29, 2015 14:26 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers: Yosemite Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned. Also, please don't email me about this script, my poor inbox...
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@ChristianBagley
ChristianBagley / hack.sh
Last active August 29, 2015 14:26 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@ChristianBagley
ChristianBagley / commandlinefu
Created January 1, 2016 21:07 — forked from seungwon0/commandlinefu
Simple shell script using commandlinefu.com API
#!/bin/sh
#
# commandlinefu - Simple shell script using commandlinefu.com API
#
# All commands sorted by date:
# % commandlinefu
#
# All commands sorted by votes:
# % commandlinefu -v
#
@ChristianBagley
ChristianBagley / app.rb
Created January 27, 2016 20:03 — forked from troelskn/app.rb
Gollum protected by HTTP Basic
require 'gollum/frontend/app'
require 'digest/sha1'
class App < Precious::App
User = Struct.new(:name, :email, :password_hash, :can_write)
before { authenticate! }
before /^\/(edit|create|delete|livepreview|revert)/ do authorize_write! ; end
helpers do
@ChristianBagley
ChristianBagley / init.lua
Created January 30, 2016 05:44 — forked from eltercero/init.lua
Config file for hammerspoon
local hotkey = require "hs.hotkey"
local application = require "hs.application"
-- HOTKEYS
local mash = {"cmd", "alt", "ctrl"}
local app_opener = {"cmd", "ctrl"}
-- Helpers
function resize_and_move(direction)
return function()