Skip to content

Instantly share code, notes, and snippets.

John Agan johnagan

Block or report user

Report or block johnagan

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
johnagan / auth.test.json
Last active Apr 29, 2017
OAuth Medium post snippets
View auth.test.json
"ok": true,
"url": "https:\/\/\/",
"team": "My Team",
"user": "cal",
"team_id": "T12345",
"user_id": "U12345"
View server.rb
require 'net/http'
require 'sinatra'
require 'json'
require 'uri'
CONTEXT = "spoof check"
'Content-Type' => 'text/json',
'Authorization' => "token #{ENV['GITHUB_TOKEN']}"
View html2slim.rb
require 'html2slim'
html_path = ""
slim_path = ""
Dir.mkdir(slim_path) unless File.exists?(slim_path)
Dir["#{html_path}/*.html"].each do |file_name|
html ='UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')"#{slim_path}/#{File.basename(file_name)}.slim", 'w') do |f|
View github.css
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px;
color: #333;
View ssh_tunnel
networksetup -setsocksfirewallproxystate Wi-Fi off
networksetup -setsocksfirewallproxystate Ethernet off
echo "SOCKS proxy disabled."
trap disable_proxy INT
networksetup -setsocksfirewallproxy Wi-Fi 9999
View .gitignore_global
# Usage
# git config --global core.excludesfile ~/.global_ignore
# General ------------------------------
# OSX ----------------------------------
johnagan /
Created May 22, 2011
A sample git hook to update webroot on commit
# Bring in Source Control
mkdir ~/repo
cd ~/repo
git init --bare
# Create a git hook
cat > hooks/post-receive
You can’t perform that action at this time.