Skip to content

Instantly share code, notes, and snippets.

@wang-steven
wang-steven / netflix_vector_ubuntu_trusty.md
Last active August 29, 2015 14:19
Netflix’s Vector on ubuntu 14.04

Taking Netflix’s Vector (Performance Monitoring Tool) For A Spin

install pcp pcp-webapi

sudo curl 'https://bintray.com/user/downloadSubjectPublicKey?username=netflixoss' | sudo apt-key add -
sudo echo "deb https://dl.bintray.com/netflixoss/ubuntu trusty main" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get install pcp pcp-webapi

start pcp service

@wang-steven
wang-steven / html5_web_notification_on_desktop
Created May 8, 2015 03:07
HTML5 web notification on desktop
<html>
<head></head>
<body>
<button>Show Desktop Notification</button>
<script type="text/javascript">
var btn = document.querySelector('button');
var notifications = window.Notification;
if (notifications) {
@wang-steven
wang-steven / install.md
Created June 2, 2017 15:16 — forked from hlb/Brewfile
clean install

System Preferences

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
defaults write NSGlobalDomain InitialKeyRepeat -int 12

# Set a blazingly fast keyboard repeat rate

Automatically Prepend a Jira Issue ID to Git Commit Messages

Use a git hook to match a Jira issue ID from the current branch, and prepend it to every commit message

Assuming the current branch contains a Jira issue ID, you can use a git hook script to prepend it to every commit message.

  1. Create an empty commit-msg git hook file, and make it executable. From your project's root directory:

     install -b -m 755 /dev/null .git/hooks/commit-msg
    
  2. Save the following script to the newly-created .git/hooks/commit-msg file:

@wang-steven
wang-steven / git-branches-by-commit-date.sh
Created October 24, 2017 01:05 — forked from jasonrudolph/git-branches-by-commit-date.sh
List remote Git branches and the last commit date for each branch. Sort by most recent commit date.
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r