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
[alias] | |
# Lists local branches ordered by last commit date, showing the latest branches at the bottom | |
brrr = for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))' | |
# Amends staged items to current commit | |
extend = commit --no-edit --amend | |
# Shorthand for checkout | |
co = checkout | |
# Shorthand for checkout trunk, it will determine the main branch e.g. master or main, and check it out | |
cot = !git co `git cwt` | |
# Checks out a new branch, expects a name to follow |
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
( | |
() => { | |
const jiraReference = window.prompt("JIRA Reference",""); | |
if (!jiraReference) { | |
window.open('INSERT_JIRA_HOMEPAGE_HERE', "_blank"); | |
} else { | |
window.open(`INSERT_JIRA_ROOT_HERE/browse/${jiraReference}`).focus();} | |
} | |
)() |
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
const getListOfFiles = function (directory) { | |
let files = []; | |
fs.readdirSync(directory).forEach(function(filename) { | |
const filePath = path.join(directory, filename); | |
const fileStatus = fs.lstatSync(filePath); | |
if (fileStatus.isFile()) { | |
// Check if image |
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
APP_NAME=$1 # "app_name" | |
URL=$2 # "appname.example.com" | |
RAILS_BUILDPACK="https://github.com/heroku/heroku-buildpack-ruby.git#v142" | |
dokku apps:create $APP_NAME | |
dokku config:set $APP_NAME BUILDPACK_URL=$RAILS_BUILDPACK | |
# Assumes PostGres sudo dokku plugin:install https://github.com/dokku/dokku-postgres.git if not installed already | |
dokku postgres:create $APP_NAME | |
dokku postgres:link $APP_NAME $APP_NAME |
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
// jest.config.js | |
module.exports = { | |
verbose: true, | |
}; |
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 | |
# Arguments: | |
# First argument: input file | |
# -ss: start time [optional] | |
# -t: end time [optional] | |
# Example usage: | |
# ./video_to_gif.sh input_file.mov | |
# ./video_to_gif.sh input_file.mov -ss 1.00 |
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
# compare_images.sh | |
# Requires imagemagick `brew update && brew install imagemagick` | |
for entry in "$1"/* | |
do | |
if [ -f "$entry" ];then | |
NAME=`basename "$entry"` | |
DIFF=`compare -metric AE "$1/$NAME" "$2/$NAME" null: 2>&1`; | |
if [ "${DIFF}" -eq "0" ]; then |
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
# lib/tasks/db.rake | |
namespace :db do | |
desc 'Drop, create, migrate then seed the development database' | |
task reseed: [ 'db:drop', 'db:create', 'db:migrate', 'db:seed' ] do | |
puts 'Reseeding completed.' | |
end | |
end |
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
import unittest | |
def calculate_addition_string(expression): | |
numbers = expression.split('+') | |
total = 0 | |
for number in numbers: | |
total += int(number) | |
return total | |
class TestAdditionMethods(unittest.TestCase): |
NewerOlder