Skip to content

Instantly share code, notes, and snippets.

View MichaelPaulukonis's full-sized avatar

Michael Paulukonis MichaelPaulukonis

View GitHub Profile
@bwillis
bwillis / git_commands.zsh
Last active November 8, 2018 02:28
Git and Github commands I use via .zshrc
# Git commands
# ggh - git url: get the url to the current github repo (assumes it's the remote push server)
# ggbn - git branch name: get the name of the current branch
# ggwip - git wip: commit the current staged and unstaged files with a commit message of WIP
# ggundo - git undo: pull the last commit off as staged changes
# ggbh - git branch history: list the 6 recent branches by commit date
# ggbs - git branch smart history: list the 6 recent branches by commit date without master, staging or production
# ggbl - git branch last: get the last branch that is not master, staging or production
alias ggh="git remote -v 2> /dev/null | grep push | awk '{print \$2}' | sed 's/:/\//' | sed 's/git@\(.*\)\.git/https:\/\/\1/'"
@sukima
sukima / ShortUrl.coffee
Last active December 10, 2015 22:38
A JavaScript (CoffeeScript) Implementation of a client side (static) URL Shortener.
# A module to handle fetching, parsing, and displaying the short urls data and
# to handle loading the long url baed on the passed in hash tag.
#
# When this is executed on a page it will load the data from a JSON file. It
# the checks if there is a hash tag in the URL. If so it redirects the page to
# the long url. If not it lists out all the short urls.
#
# For example, `http://mysite.com/s/` will display the list and
# `http://mysite.com/s/#1` will redirect to the associated url for the id 1.
#
@rawsyntax
rawsyntax / js2-mode.el
Created May 31, 2012 21:19
js2-mode with better indentation
(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
(add-to-list 'auto-mode-alist '("\\.json$" . js2-mode))
;; Use js-mode indentation in js2-mode, I don't like js2-mode's indentation
;;
;; thanks http://mihai.bazon.net/projects/editing-javascript-with-emacs-js2-mode
;; with my own modifications
;;
(defun my-js2-indent-function ()
@domenic
domenic / portable-node.md
Created May 25, 2012 21:03
Tips for Writing Portable Node.js Code

Node.js core does its best to treat every platform equally. Even if most Node developers use OS X day to day, some use Windows, and most everyone deploys to Linux or Solaris. So it's important to keep your code portable between platforms, whether you're writing a library or an application.

Predictably, most cross-platform issues come from Windows. Things just work differently there! But if you're careful, and follow some simple best practices, your code can run just as well on Windows systems.

Paths and URLs

On Windows, paths are constructed with backslashes instead of forward slashes. So if you do your directory manipulation

@atduskgreg
atduskgreg / actants.asciidoc
Created February 29, 2012 23:53
A list of every example actant mentioned in the first half of Prince of Networks by Graham Harman

A list of every example actant mentioned in the first half of Prince of Networks by Graham Harman

"These long lists of random actors must continue until their plurality and autonomy is no longer suppressed. We still know nothing about these objects or what they entail. All that is clear is their metaphysical equality. The world is a stage filled with actors; philosophy is object-oriented philosophy." — Harman, Prince of Networks.

"[These lists are] a repeated sorcerer’s chant of the multitude of things that resist any unified empire." — Harman, Prince of Networks

  • lactc acid ferment

  • city of Rouen

  • the laboratory on the Rue d’Ulm

  • God

@nibrahim
nibrahim / line-length-sort.el
Created October 22, 2010 10:34
Sort lines by length
(defun sort-lines-by-length (b e)
(interactive "r")
(save-excursion
(save-restriction
(narrow-to-region b e)
(let ((items (sort
(split-string
(buffer-substring (point-min) (point-max)) "[\n]")
(lambda(x y) (< (length x) (length y)))))
)