This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define the range of commits in this deploy. | |
old_sha="87d4fed" | |
new_sha="2d5b22d" | |
# Define a comment to be posted to each story. | |
deploy_id="v1.1234" | |
deploy_url="https://github.com/company/repo/compare/$old_sha...$new_sha" | |
comment="This story was deployed as part of $deploy_id.$deploy_url" | |
# Move stories to deployed and post a comment. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
old_sha="87d4fed" | |
new_sha="2d5b22d" | |
git log $old_sha..$new_sha --oneline | |
# 2d5b22d Merge pull request #6 from company/me/ch345/my-story-name | |
# e730351 Fix bug | |
# c410ba0 Fix other bug [ch1004] | |
function clubhouse_find_stories_in_commit_range { | |
old_sha="$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Associate a branch with story 123: | |
git checkout -b ac/ch123/my-story-name | |
# Or, you might want to associate a single commit with story 123: | |
git commit -m "Fix bug [ch234]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Clubhouse / git / deploy utility functions | |
# | |
# API docs: https://clubhouse.io/api | |
# | |
# Assuming the following: | |
# 1. We have a range of git commits that represent the changes being deployed | |
# 2. Our git branches and pull requests use the username/ch123/story-name format, | |
# so that "ch123" ends up in a commit message | |
# 3. We have a Clubhouse API token set to the $CLUBHOUSE_API_TOKEN environment variable | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# gitbr | |
# | |
# Example output: | |
# | |
# $ gitbr | |
# | |
# 3 months ago ac/1999/labels-redesign-spike | |
# 745f166 WIP. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List users by average and maximum session length. | |
SELECT person, max(client.runtime_ms), avg(client.runtime_ms) | |
FROM item_occurrence | |
GROUP BY 1 | |
ORDER BY 2 DESC | |
# List active date ranges for each deploy. | |
SELECT client.javascript.code_version, min(timestamp), max(timestamp) | |
FROM item_occurrence | |
GROUP BY 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Run every minute using cron: | |
# */1 * * * * /path/to/mysqlrestarter > /dev/null 2>&1 | |
serverName="website.com" | |
adminEmail="[email protected]" | |
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" | |
UP=$(service mysql status | grep 'mysql start/running' | wc -l); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Librato.sh | |
# Send basic VM health stats to Librato: | |
# - Network bytes sent/received | |
# - IO reads/writes | |
# - 1min, 5min, 15min load averages | |
# - Disk used/free | |
# - Memory used/free |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Jasmine Unit Test Generator | |
# Assumes the codebase uses this module pattern: | |
# (https://gist.github.com/andrewchilds/ffcae28b2b01c5fbbb12) | |
# App.module('ModuleName', function (exports) { | |
# exports.myFunctionName = function () {}; | |
# }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var App = (function () { | |
var pub = {}; | |
pub.module = function (ns, fn) { | |
var context = pub; | |
var modules = ns.split('.'); | |
var last = modules.pop(); | |
for (var i = 0; i < modules.length; i++) { | |
context[modules[i]] = context[modules[i]] || {}; |