Skip to content

Instantly share code, notes, and snippets.

View andxyz's full-sized avatar
:octocat:
ship it

Andrew Stevens andxyz

:octocat:
ship it
View GitHub Profile
@andxyz
andxyz / gist:1828bf3b0947b1be2a93fd440b1ed149
Created December 7, 2016 22:36
Writing Commit Messages

Writing Commit Messages

One line summary (< 50c)

Longer description (wrap at 72c)

Summary

@andxyz
andxyz / defaults.rb
Created April 12, 2016 05:17 — forked from stevenharman/defaults.rb
A subtle difference between Ruby's Hash.fetch(:key, :default) vs. (Hash[:key] || :default)
h = {
'a' => :a_value,
'b' => nil,
'c' => false
}
h.fetch('a', :default_value) #=> :a_value
h.fetch('b', :default_value) #=> nil
h.fetch('c', :default_value) #=> false
h.fetch('d', :default_value) #=> :default_value
user="kibana"
group="root"
chroot="/"
chdir="/"
nice=""
@andxyz
andxyz / 030_update_platform_config.js
Created November 9, 2015 20:46 — forked from marcocarnazzo/030_update_platform_config.js
Ionic/Cordova update platform config
#!/usr/bin/env node
/** This hook updates platform configuration files based on preferences and config-file data defined in config.xml.
Currently only the AndroidManifest.xml and IOS *-Info.plist file are supported.
See http://stackoverflow.com/questions/28198983/ionic-cordova-add-intent-filter-using-config-xml
Preferences:
1. Preferences defined outside of the platform element will apply to all platforms
2. Preferences defined inside a platform element will apply only to the specified platform
@andxyz
andxyz / licenses-api.sh
Last active November 11, 2015 16:33 — forked from mislav/licenses-api.sh
An example of using the GitHub Licenses API, currently in preview.
#!/usr/bin/env bash
curl -s -H 'Accept: application/vnd.github.drax-preview+json' \
https://api.github.com/orgs/scoremedia/repos?per_page=100 | \
grep -A1 '"license"' | grep '"key"' | cut -d'"' -f4 | \
sort | uniq -c
# 5 apache-2.0
# 1 bsd-3-clause
# 2 cc0-1.0
sudo find /private/var/folders/ -name com.apple.dock.iconcache -exec rm {} \;