-
#2c292d
$\textcolor{#2c292d}{\texttt{█ black}}$ -
#fdf9f3
$\textcolor{#fdf9f3}{\texttt{█ white}}$ -
#ff6188
$\textcolor{#ff6188}{\texttt{█ red}}$ -
#fc9867
$\textcolor{#fc9867}{\texttt{█ orange}}$ -
#ffd866
$\textcolor{#ffd866}{\texttt{█ yellow}}$ -
#a9dc76
$\textcolor{#a9dc76}{\texttt{█ green}}$ -
#78dce8
$\textcolor{#78dce8}{\texttt{█ blue}}$ -
#ab9df2
$\textcolor{#ab9df2}{\texttt{█ purple}}$
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
require 'time' | |
branches = `git for-each-ref --format '%(refname:short) %(committerdate)' refs/heads/` | |
months_ago = 12 | |
threshold = Time.now - (months_ago * 30 * 24 * 60 * 60) | |
branches_to_delete = {} | |
branches.each_line do |line| |
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] | |
l = log --pretty=format:'%C("#ff6188")%h%Creset -%C("#ffd866")%d%Creset %C("#a9dc76")(%cr)%Creset %C("#78dce8")<%an>%Creset%n%s%n%n%b' --abbrev-commit --date=relative | |
sl = stash list --pretty=format:'%C("#ff6188")%h%Creset -%C("#ffd866")%d%Creset %C("#a9dc76")(%cr)%Creset %C("#78dce8")<%an>%Creset%n%s%n%n%b' --abbrev-commit --date=relative | |
# colors from: https://gist.github.com/jjb/366bed1d5f099a42f0da0f64b5b52798 |
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
sudo port install libyaml yaml-cpp | |
bundle config build.psych --with-opt-include=/opt/local/include --with-opt-lib=/opt/local/lib | |
bundle | |
# OR, standalone | |
gem install psych -- --with-opt-include=/opt/local/include --with-opt-lib=/opt/local/lib |
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
# need to "pin" the variable, but this only works with the lambda because | |
# pattern matching falls back to case matchint (=== on any object in ruby, | |
# which is NOT "identical object" as in JS) | |
def matches1(pat,x) | |
case x | |
in ^pat | |
puts true | |
else | |
puts false | |
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
[alias] | |
delete-squashed = "!f() { local targetBranch=${1:-master} && git checkout -q $targetBranch && git branch --merged | grep -v \"\\*\" | xargs -n 1 git branch -d && git for-each-ref refs/heads/ \"--format=%(refname:short)\" | while read branch; do mergeBase=$(git merge-base $targetBranch $branch) && [[ $(git cherry $targetBranch $(git commit-tree $(git rev-parse $branch^{tree}) -p $mergeBase -m _)) == \"-\"* ]] && git branch -D $branch; done; }; f" | |
Note
here is some important info
- item 1
[!NOTE] here is some important info
- item 2
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
# in default config, ActionMailer will use sidekiq wrapped in ActiveJob | |
# This makes it so there is no obvious/direct place to specify configuration | |
# It's easy to do with the below method, which can be placed in an initializer | |
Rails.application.config.after_initialize do | |
ActionMailer::MailDeliveryJob.class_eval do | |
sidekiq_options retry: 2 | |
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
require 'benchmark/ips' | |
require "benchmark/memory" | |
Benchmark.ips do |x| | |
x.report("rand") do | |
rand | |
end | |
x.report("rand(100)") do | |
rand(100) |
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
#!/usr/bin/env sh | |
# usage | |
# shipyard-shell PRNUMBER SERVICENAME | |
# shipyard-shell 6187 postgres | |
# shipyard-shell 6187 api | |
pr=$1 | |
service=$2 | |
identifier=`shipyard get environments | grep pr$pr | xargs | cut -w -f1` # xargs to remove leading and trailing whitespace |
NewerOlder