Skip to content

Instantly share code, notes, and snippets.


Eric Dorsey ericdorsey

View GitHub Profile
so0k /
Last active Oct 22, 2021
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
bonzanini /
Last active Aug 8, 2021
Twitter Stream Downloader
consumer_key = 'your-consumer-key'
consumer_secret = 'your-consumer-secret'
access_token = 'your-access-token'
access_secret = 'your-access-secret'
coderofsalvation / hubottest
Last active Jul 9, 2017
commandline wrapper script to invoke hubot commands from the commandline (handy for testing while developing) using expect
View hubottest
#!/usr/bin/expect -f
# usage: ./hubottest "hubot help"
spawn bin/
sleep 3
expect "Hubot>"
send "hubot [lrange $argv 0 10]\n"
expect eof
marianposaceanu /
Last active Jun 21, 2021
How to have some fun using the terminal.

Linux fun-o-matic

How to have some fun using the terminal.

  1. Install cowsay [0] via : sudo apt-get install cowsay
  2. Install fortune [1] via : sudo apt-get install fortune
  3. Make sure you have Ruby installed via : ruby -v
  4. Install the lolcat [2] via : gem gem install lolcat
  5. Profit!
joallard /
Created Sep 11, 2013
So, you've merged yourself

So, you've merged the master branch with itself, and you ended up with a merge commit nobody wanted.

The problem

Let me tell you a little story...

John and Pete are working together on a repo.

$ git log --graph --pretty=oneline --abbrev-commit  # an alias I have under 'git lol', but 'gitk' does just fine
* 812492b (master, origin/master, origin/HEAD) Add stuff
akluth /
Created May 2, 2013
CoffeeScript: JSON-Objects, Arrays
# Considering an JSON object like this one:
# {
# "store": {
# "foo": {
# "value":"bar"
# }
# },
# "anotherstore": {
# "wat":{
phette23 /
Last active Oct 17, 2021
Set the iTerm tab title to the current directory, not full path.
# put this in your .bash_profile
if [ $ITERM_SESSION_ID ]; then
export PROMPT_COMMAND='echo -ne "\033];${PWD##*/}\007"; ':"$PROMPT_COMMAND";
# Piece-by-Piece Explanation:
# the if condition makes sure we only screw with $PROMPT_COMMAND if we're in an iTerm environment
# iTerm happens to give each session a unique $ITERM_SESSION_ID we can use, $ITERM_PROFILE is an option too
# the $PROMPT_COMMAND environment variable is executed every time a command is run
# see:


  • C-a == Ctrl-a
  • M-a == Alt-a


:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
asabaylus / gist:3071099
Created Jul 8, 2012
Github Markdown Heading Anchors
View gist:3071099

Anchors in Markdown

To create an anchor to a heading in github flavored markdown. Add - characters between each word in the heading and wrap the value in parens (#some-markdown-heading) so your link should look like so:

[create an anchor](#anchors-in-markdown)

coolaj86 /
Last active Oct 10, 2021
How to publish packages to NPM

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set "Your Name"
npm set ""
npm set "https:/"

npm adduser