Skip to content

Instantly share code, notes, and snippets.

Avatar

Eric Dorsey ericdorsey

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

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
bonzanini / config.py
Last active Aug 8, 2021
Twitter Stream Downloader
View config.py
consumer_key = 'your-consumer-key'
consumer_secret = 'your-consumer-secret'
access_token = 'your-access-token'
access_secret = 'your-access-secret'
@coderofsalvation
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/hubot.coffee
sleep 3
expect "Hubot>"
send "hubot [lrange $argv 0 10]\n"
expect eof
@marianposaceanu
marianposaceanu / linux_fun.md
Last active Jun 21, 2021
How to have some fun using the terminal.
View linux_fun.md

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
joallard / 20130910-merge-commit.md
Created Sep 11, 2013
So, you've merged yourself
View 20130910-merge-commit.md

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
akluth / array.coffee
Created May 2, 2013
CoffeeScript: JSON-Objects, Arrays
View array.coffee
# Considering an JSON object like this one:
#
# {
# "store": {
# "foo": {
# "value":"bar"
# }
# },
# "anotherstore": {
# "wat":{
@phette23
phette23 / current-dir-in-iterm-tab-title.sh
Last active Oct 17, 2021
Set the iTerm tab title to the current directory, not full path.
View current-dir-in-iterm-tab-title.sh
# put this in your .bash_profile
if [ $ITERM_SESSION_ID ]; then
export PROMPT_COMMAND='echo -ne "\033];${PWD##*/}\007"; ':"$PROMPT_COMMAND";
fi
# 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: ss64.com/bash/syntax-prompt.html
View vim_cheatsheet.md

Introduction

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

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
@asabaylus
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
coolaj86 / how-to-publish-to-npm.md
Last active Oct 10, 2021
How to publish packages to NPM
View how-to-publish-to-npm.md

Getting Started with NPM (as a developer)

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

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "https:/yourblog.com"

npm adduser