Skip to content

Instantly share code, notes, and snippets.

View clementf's full-sized avatar

Clément Férey clementf

View GitHub Profile
#!/bin/sh
# Set up Rails app. Run this script immediately after cloning the codebase.
# Exit if any subcommand fails
set -e
# Copy over configs
if ! [ -f .env ]; then
cp .sample.env .env
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@palkan
palkan / Gemfile
Last active April 27, 2024 02:02
FactoryProf: profiler for your FactoryGirl
# if you want to render flamegraphs
gem "stackprof", require: false # required by flamegraph
gem "flamegraph", require: false
@palkan
palkan / factory_doctor.rb
Created March 27, 2017 15:42
FactoryDoc: detect useless data generation in tests
module FactoryGirl
module Doctor
module FloatDuration
refine Float do
def duration
t = self
format("%02d:%02d.%03d", t / 60, t % 60, t.modulo(1) * 1000)
end
end
end
@eyecatchup
eyecatchup / git-commit-log-stats.md
Last active March 26, 2026 00:37
Some commands to get git commit log statistics for a repository on the command line.

git commit stats

Commands to get commit statistics for a Git repository from the command line -
using git log, git shortlog and friends.




@monolithed
monolithed / yosemite
Last active August 11, 2016 09:04
Mac OS Yosemite fixes
[port]:
1. Install Xcode-Beta from https://developer.apple.com/xcode/downloads/
2. ➜ sudo xcode-select -s /Applications/Xcode-Beta.app/Contents/Developer/
3. ➜ sudo xcodebuild -license
4. ➜ sudo port clean install
[brew]:
➜ cd `brew --repository`
➜ git reset --hard FETCH_HEAD
➜ sudo chown -R `whoami` `brew --prefix`
@coreyhaines
coreyhaines / churn script
Created February 16, 2011 19:04
Bash script to generate churn counts in git repo
churn number and file name
git log --all -M -C --name-only | grep -E '^(app|lib)/' | sort | uniq -c | sort | awk 'BEGIN {print "count,file"} {print $1 "," $2}'
churn number and file name w/ limiting to last n commits
git log --all -n 5000 -M -C --name-only | grep -E '^spec/models' | sort | uniq -c | sort | awk 'BEGIN {print "count,file"} {print $1 "," $2}'
graph of churn number and frequency
git log --all -M -C --name-only | grep -E '^(app|lib)/' | sort | uniq -c | sort | awk '{print $1}' | uniq -c | sort | awk 'BEGIN { print "frequency,churn_count"} { print $1,$2}'