Skip to content

Instantly share code, notes, and snippets.

View brock's full-sized avatar
😎

Brock Angelo brock

😎
View GitHub Profile
@brock
brock / hack.sh
Created November 14, 2012 05:36 — forked from neil477/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
#
@brock
brock / vimblog.vim
Created November 21, 2012 04:55 — forked from gavinzhou/vimblog.vim
vimblog
" Requirements:
" - you'll need VIM compiled with Ruby scripting support
" - example: for Debian/Ubuntu: sudo apt-get install vim-ruby
" - please, copy this file to one of your VIM dir
" - example: to your .vim home folder: $HOME/.vim/vimlog.vim
" - please, add this code to your .vimrc file:
"
" if !exists('*Wordpress_vim')
" runtime vimlog.vim
" endif
@brock
brock / gist:4123148
Created November 21, 2012 05:11 — forked from yuhonas/gist:4122118
iTerm / Sublime AppleScript
tell application "System Events"
# create an iTerm session if we dont have one
if not (exists (processes where name is "iTerm")) then
tell application "iTerm" to (make new terminal)
end if
tell application "iTerm"
activate
tell the current terminal
set SublimeSessionName to "sublime"
@brock
brock / caveatPatchor.js
Created December 9, 2012 18:13
Propane Avatars
/*
As of version 1.1.2, Propane will load and execute the contents of
~Library/Application Support/Propane/unsupported/caveatPatchor.js
immediately following the execution of its own enhancer.js file.
You can use this mechanism to add your own customizations to Campfire
in Propane.
Below you'll find two customization examples.
@brock
brock / caveatPatchor.js
Created December 9, 2012 18:21
Propane Avatars and HTML5 Audio Support
/*
As of version 1.1.2, Propane will load and execute the contents of
~Library/Application Support/Propane/unsupported/caveatPatchor.js
immediately following the execution of its own enhancer.js file.
You can use this mechanism to add your own customizations to Campfire
in Propane.
Below you'll find two customization examples.
@brock
brock / vpn.sh
Last active December 10, 2015 14:18
A function to start the OSX VPN from the command line. Just modify "My VPN Name" to the name you have in Network Preferences. Then from the command line run: vpn.
# place this with other bash functions in either ~/.bash_profile or a similar location
vpn () {
/usr/bin/env osascript <<EOF
tell application "System Events"
tell current location of network preferences
set VPN to service "My VPN Name"
if exists VPN then connect VPN
end tell
end tell
@brock
brock / rvm-sudo.md
Created March 8, 2013 20:42
What to do when RVM fucks with your sudo PATH

##What to do when RVM fucks with your sudo PATH

echo 'echo $PATH' > path.sh   
bash path.sh
sudo bash path.sh

If you see a difference, look in /etc/sudoers or /etc/sudoers.d/

@brock
brock / restore-java.sh
Created April 25, 2013 17:59
restore java in osx 10.8
#!/bin/bash
sudo mkdir -p /Library/Internet\ Plug-Ins/disabled
sudo mv /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin /Library/Internet\ Plug-Ins/disabled
sudo ln -sf /System/Library/Java/Support/Deploy.bundle/Contents/Resources/JavaPlugin2_NPAPI.plugin /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo ln -sf /System/Library/Frameworks/JavaVM.framework/Commands/javaws /usr/bin/javaws
@brock
brock / read_one_bucket.json
Last active December 18, 2015 04:39
Simple AWS IAM Group policy to limit a client to read-only access to a single bucket. They'll be able to see the names of all other buckets, but won't be able to get into them. They will be able to see all folders and files in the bucket.
{
"Statement": [
{
"Effect": "Allow",
"Action": ["s3:ListBucket", "s3:ListAllMyBuckets" ],
"Resource": "arn:aws:s3:::*"
},
{
"Effect": "Deny",
"Action": ["s3:ListBucket"],
#!/usr/bin/env ruby
#
# [email protected] July 2012
#
# I'm playing around with APIs, and sharing my learnings
# You can follow my trials and tribulations at http://viewyonder.com/apis
#
# This is a simple Ruby script to show how a simple API might work.
# The resource model is just a simple array of a single class - no back-end store (yet)
#