Skip to content

Instantly share code, notes, and snippets.

View lazyatom's full-sized avatar
🤠
Yes

James Adam lazyatom

🤠
Yes
View GitHub Profile
@marksim
marksim / README.md
Last active September 28, 2018 15:56
Pair Sessions Script Adding more security (automatically timeout sudo, append the command to each ssh key

My script for pair sessions on my box.

What it does

  • downloads the appropriate ssh keys from github
  • copies the appropriate 'ssh pair@your-external-ip' command to your clipboard (see Note #1)
  • sets up the tmux session
  • cleans up the session, and the keys after it's done

How to use

@nickludlam
nickludlam / gist:4666172
Last active December 11, 2015 21:58
A section of my .profile which puts the running VM count into the prompt.
function parse_vagrant_vms {
# Use sed to strip out the whitespace, can't seem to get wc to give nice formatting standalone
# Thanks to @pkqk for showing me the speedy 'VBoxManage' command
local vm_count=$(VBoxManage list runningvms | wc -l | sed 's/^ *//; s/; */;/g')
# I use curly braces to mean vm count, edit to taste
if [ $vm_count -eq 1 ]; then
echo "{${vm_count}vm}"
fi
if [ $vm_count -gt 1 ]; then
echo "{${vm_count}vms}"
@techbelly
techbelly / gist:3333673
Created August 12, 2012 18:51
IF in campfire
#!/usr/bin/env ruby
require 'rubygems'
require 'tinder'
require 'open3'
require 'eventmachine'
# CHANGE THESE TO FIT
config = {
# CAMPFIRE USER DETAILS
@kersny
kersny / lambda.coffee
Created December 14, 2011 03:26
http://experthuman.com/programming-with-nothing in CoffeeScript (my first CS code)
INCREMENT = (n) -> (p) -> (x) -> p(n(p)(x))
DECREMENT = (n) -> (f) -> (x) -> n((g) -> (h) -> h(g(f)))((y) -> x)((y) -> y)
ADD = (m) -> (n) -> n(INCREMENT)(m)
SUBTRACT = (m) -> (n) -> n(DECREMENT)(m)
MULTIPLY = (m) -> (n) -> n(ADD(m))(ZERO)
POW = (m) -> (n) -> n(MULTIPLY(m))(ONE)
ZERO = (f) -> (x) -> x
ONE = (f) -> (x) -> f(x)
@tomstuart
tomstuart / gist:1466504
Created December 12, 2011 10:40
FizzBuzz in the lambda calculus in Ruby
>> IF = -> b { b }
=> #<Proc:0x007fb4e4049cc8 (lambda)>
>> LEFT = -> p { p[-> x { -> y { x } } ] }
=> #<Proc:0x007fb4e403d680 (lambda)>
>> RIGHT = -> p { p[-> x { -> y { y } } ] }
=> #<Proc:0x007fb4e4028ff0 (lambda)>
>> IS_EMPTY = LEFT
@chrisroos
chrisroos / git-compare-upstream.rb
Created April 21, 2011 16:15
This attempts to show useful differences between two repos (probably your fork and the upstream original)
#!/usr/bin/env ruby
# This attempts to show useful differences between an upstream repo and your local copy.
# The motivation is that I want to be able to see differences between my forks of other github repos.
unless upstream_repo = ARGV.shift
puts "Usage: #{File.basename(__FILE__)} upstream-repo"
exit 1
end
@technoweenie
technoweenie / github_oauth_busy_developer_guide.md
Created May 30, 2010 18:34
GitHub OAuth Busy Developer's Guide

GitHub OAuth Busy Developer's Guide

This is a quick guide to OAuth2 support in GitHub for developers. This is still experimental and could change at any moment. This Gist will serve as a living document until it becomes finalized at Develop.GitHub.com.

OAuth2 is a protocol that lets external apps request authorization to private details in your GitHub account without getting your password. All developers need to register their application before getting started.

Web Application Flow

  • Redirect to this link to request GitHub access: