Skip to content

Instantly share code, notes, and snippets.

View gregdeane's full-sized avatar

Greg Deane gregdeane

  • Berlin, Germany
  • 04:21 (UTC +02:00)
View GitHub Profile
@gregdeane
gregdeane / steps-to-autogenerate-changelog.md
Created February 4, 2016 13:57
Steps to auto-generate changelog
  1. Make changes
  2. Commit those changes
  3. Make sure Travis turns green
  4. Bump version in package.json
  5. conventionalChangelog
  6. Commit package.json and CHANGELOG.md files
  7. Tag
  8. Push

The reason why commit and tag should be run after conventionalChangelog is that the CHANGELOG should be included in the new release.

@gregdeane
gregdeane / commit.md
Last active June 2, 2016 12:45
Git commit rules
@gregdeane
gregdeane / parse.md
Last active October 7, 2016 09:57
Parse URL
/**
 * Return url split into its parts
 * If `key` is passed, return that part of the url
 * If `key` is passed but not found, return all of the parts
 *
 * Allowed keys: "url", "scheme", "host", "port", "path", "query", "hash"
 *
 * @param {string} url - Url to parse
 * @param {string} key - "url", "scheme", "host", "port", "path", "query", "hash"
@gregdeane
gregdeane / seating-specs.md
Last active October 12, 2016 12:31
How to sit at your desk

How to Sit at Your Desk

Seating Specs

@gregdeane
gregdeane / .bashrc
Last active October 15, 2016 14:19
JAVA_HOME=/usr/libexec/java_home
SCALA_HOME=/usr/local/opt/scala/idea
NPM_PACKAGES=/Users/[username]/.npm-packages
NODE_PATH="$NPM_PACKAGES/lib/node_modules:$NODE_PATH"
PATH="$NPM_PACKAGES/bin:$PATH:$SCALA_HOME:$JAVA_HOME"
@gregdeane
gregdeane / snippets.md
Created January 4, 2017 11:34
Random code snippets

Snippets

Replace underscores with hyphens in file and directory names

# perform a dry run first
for i in *; do echo mv "$i" "`echo $i | sed -e 's,_,-,g'`"; done

# actually run the command
for i in *; do mv "$i" "`echo $i | sed -e 's,_,-,g'`"; done
@gregdeane
gregdeane / mac-erase-encrypt-external-drive.md
Created January 14, 2017 07:46
Mac / Erase and Encrypt External Drive

Mac / Erase and Encrypt External Drive

  1. Open Disk Utility and click on the drive (not the partition)
  2. Click Erase button
  3. Choose Name
  4. Choose Format: OS X Extended (Journaled)
  5. Choose Scheme: GUID Partition Map
  6. Click Erase button
  7. When complete, open Finder
  8. Right-click on the new drive partition
@gregdeane
gregdeane / system.yuml.js
Last active February 25, 2017 13:42
Helper method to visually display SystemJS dependency relationships using http://yuml.me/
System.trace = true;
window.showModuleRelationships = function () {
var modules = Object.keys(System.loads)
.map(function (moduleName) {
return System.loads[moduleName];
});
function displayName(module) {
return module
.replace(System.baseURL, '')
@gregdeane
gregdeane / ssh-known-hosts-mgmt.sh
Last active July 12, 2019 14:56 — forked from bradland/ssh-known-hosts-mgmt.sh
SSH known_hosts tools
# This is a short collection of tools that are useful for managing your
# known_hosts file. In this case, I'm using the '-f' flag to specify the
# global known_hosts file because I'll be adding many deploy users on this
# system. Simply omit the -f flag to operate on ~/.ssh/known_hosts
# Add entry for host
# ssh-keyscan -H github.com > /etc/ssh/ssh_known_hosts
ssh-keyscan -H github.com > ~/.ssh/known_hosts
# Scan known hosts
@gregdeane
gregdeane / .bash_profile
Last active January 2, 2020 14:15
Machine setup
# standard aliases
alias www="cd ~/www"
alias gist="cd ~/www/gist"
# npm-related aliases
alias npmlist="npm list -g --depth=0"
# git-related aliases
alias recent='for k in `git branch | perl -pe s/^..//`; do echo -e `git show --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" $k -- | head -n 1`\\t$k; done | sort -r | head'
alias listr="git for-each-ref refs/remotes/ --format='%(authorname) %(refname)' --sort=authorname"