Skip to content

Instantly share code, notes, and snippets.

View benjaminoakes's full-sized avatar

Ben Oakes benjaminoakes

View GitHub Profile
@benjaminoakes
benjaminoakes / run-changed-tests.sh
Last active March 31, 2017 16:43
Rails: Run Changed Tests
#!/bin/sh
extant_files=""
for file in $(git diff --name-only master . | grep '^test' | grep -v '^test/factories' | grep -v '^test/support'); do
if [ -f "$file" ]; then
extant_files="$extant_files $file"
fi
done
set -x
@benjaminoakes
benjaminoakes / git-run-ci
Last active March 31, 2017 16:43
Push to a run-ci (whitelisted) branch to run CI on Travis, etc.
#!/bin/sh
show_usage() {
cat <<EOF
Usage: $0 branch_name
Push to a run-ci (whitelisted) branch to run CI on Travis, etc.
NOTE: this is only necessary for a project like WebAdMIT that has disabled CI
for branches by default. We explicitly whitelisted \`run-ci/*\`.
@benjaminoakes
benjaminoakes / enable_rake_tasks.diff
Created July 11, 2016 20:00
Why doesn't houndci.com check Rake tasks? (Rubocop does with this config...)
diff --git a/.ruby-style.yml b/.ruby-style.yml
index 28b4f49..8933d44 100644
--- a/.ruby-style.yml
+++ b/.ruby-style.yml
@@ -1,4 +1,11 @@
AllCops:
+ Include:
+ - '**/*.rb'
+ - '**/*.rake'
+ - '**/config.ru'
@benjaminoakes
benjaminoakes / allo.yml
Last active September 21, 2016 14:41
Google Template
---
product: Allo
service: Messaging
@benjaminoakes
benjaminoakes / Notes.md
Last active September 28, 2016 19:07
Meta Meetup 2016-09-28

Must do

  • Have another one of these meta meetups!

@chrisortman suggested an "open space" style meetup so people can break off and discuss topics.

  • Find out where meetup donations go.

I looked into this and Jerry is the only one with access to this part of the account. Still need to transfer total ownership over from him.

@benjaminoakes
benjaminoakes / install_docker_for_mac
Created October 20, 2016 17:08
Install Docker for Mac
#!/bin/sh
log_info() {
echo "[info] $*"
}
log_warn() {
echo "[warn] $*"
}
@benjaminoakes
benjaminoakes / foo.csv
Created October 24, 2016 20:05
CSV test
foo bar baz
1 2 3
a b c
class MyClass
def foo
@foo
end
def initialize(foo)
@foo = foo
end
def bar
@benjaminoakes
benjaminoakes / Dockerfile
Created January 10, 2017 21:04
Docker: use readline vi mode
# Set up dotfiles. (It would be amazing if there were an environment variable for this instead!)
RUN printf "set editing-mode vi\nset keymap vi" > ~/.inputrc
RUN printf "bind -v" > ~/.editrc
@benjaminoakes
benjaminoakes / problem_3.js
Last active March 22, 2017 14:31
Project Euler
function find(start, finish, qualifier) {
var index;
for (index = start; start <= finish; index++) {
if (qualifier(index)) {
return index;
}
}
}