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
ready = -> | |
preloadImages = (imageFilePathArray) -> | |
images = new Array | |
for filePath, index in imageFilePathArray | |
images[index] = new Image() | |
images[index].src = filePath | |
imageFilePathArray = [ |
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
apt-get update | |
apt-get install -y build-essential chrpath libssl-dev libxft-dev | |
apt-get install -y libfreetype6 libfreetype6-dev | |
apt-get install -y libfontconfig1 libfontconfig1-dev | |
apt-get install -y wget | |
cd ~ | |
export PHANTOM_JS="phantomjs-1.9.8-linux-x86_64" | |
wget https://bitbucket.org/ariya/phantomjs/downloads/$PHANTOM_JS.tar.bz2 | |
mv $PHANTOM_JS.tar.bz2 /usr/local/share/ | |
cd /usr/local/share/ |
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/bash | |
rubocop $(git diff --name-only --diff-filter=d main...) --force-exclusion "$@" |
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/bash | |
reek --force-exclusion "$@" $(git status --porcelain | sed s/^...//) |
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
def to_age | |
today = Time.current | |
year_diff = today.year - year | |
today_is_past_birthday = today.month > month || (today.month == month && today.day >= day) | |
today_is_past_birthday ? year_diff : year_diff - 1 | |
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
namespace :db do | |
desc 'Dumps the database to db/backups' | |
task :dump, [:backup_name] => :environment do |_task, args| | |
params = gather_required_data(args) | |
cmd = [ | |
'pg_dump', | |
'-F c', | |
'-v', | |
'-h', params[:host], |
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
class String | |
def colorize(color_code) | |
"\e[#{color_code}m#{self}\e[0m" | |
end | |
def red | |
colorize(31) | |
end | |
def green |
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
if ENV['CI'] | |
config.before(:example, :focus) { | |
raise "You've added a focused spec to a commit, this'll prevent CI from running properly and you should remove this." | |
} | |
else | |
config.filter_run focus: true | |
config.run_all_when_everything_filtered = true | |
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
git log -S <string> path/to/file |
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/bash | |
git diff --name-only --diff-filter=d main... |
OlderNewer