Note
here is some important info
- item 1
[!NOTE] here is some important info
- item 2
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 |
# 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 |
[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
[!NOTE] here is some important info
# 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 |
require 'benchmark/ips' | |
require "benchmark/memory" | |
Benchmark.ips do |x| | |
x.report("rand") do | |
rand | |
end | |
x.report("rand(100)") do | |
rand(100) |
#!/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 |
If you are in a situation where rubocop is hanging on a file but you don't know which one,
afaik there is no way to have rubocop pring each filename as it runs it. None of the formatters
do this and there is no verbose mode. Even --debug
does not do this.
Here is a hack to (very slowly) invoke rubocop once for each candidate file:
bundle exec rubocop --list-target-files > files.txt
cat files.txt | xargs -L1 -n1 bundle exec rubocop # this works on macos/bsd, use --verbose instead of -t on linux
apt update | |
apt install -y apt-file | |
apt-file update | |
apt-file find psql | |
apt-file find bin/psql | |
apt-file find postgresql.conf | |
apt-file find --fixed-string convert # equivalent of .*convert.*, way too much | |
apt-file find --fixed-string /usr/bin/convert # need to know exact path | |
apt-file find --regexp '.*bin/convert$' # bingo. would also pick up .../sbin/ |
old=`pbpaste` | |
`echo '#{ENV['THE_TEXT']}' | pbcopy` | |
3.downto(0) do |second| | |
`osascript -e 'display notification "Reseting clipboard in #{second} seconds" with title "TMP Clipboard"'` | |
sleep 1 | |
end | |
`echo '#{old}' | pbcopy` |