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 | |
# Depends on pngbai script: https://gist.github.com/acrookston/6877287 | |
# And don't forget to install pngbai's dependencies (documeted there) | |
FILES=`git diff --name-only origin/master | grep '\.png$'` | |
for file in $FILES; do | |
echo "$file" | |
git add $file | |
pngbai $file "${file}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
#!/bin/sh | |
## Packages: | |
# brew install pngcrush optipng advancecomp | |
# brew install https://gist.github.com/acrookston/7726731/raw/3e3ce6c177a450c375e3622636f4d55bbe5289f6/pngout.rb | |
function usage { | |
echo "Usage: $0 infile outfile" | |
exit 1 | |
} |
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 | |
DEVICES=`adb devices | tail -n +2 | cut -f1` | |
for DEVICE in $DEVICES | |
do | |
RUN="adb -s $DEVICE $@" | |
echo $RUN | |
${RUN} | |
done |
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 'rmagick' | |
number_of_colors = 100 | |
file_path = "/path/to/file.jpg" | |
begin | |
temp_file = Magick::Image.read(file_path).first.quantize(number_of_colors) | |
pixels = {} | |
pixel_count = 0 | |
temp_file.each_pixel do |p,c,r| | |
pixel_count += 1 | |
pix = p.to_color(Magick::AllCompliance, false, 8) |
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 'formula' | |
class Pngout < Formula | |
url 'http://static.jonof.id.au/dl/kenutils/pngout-20110722-darwin.tar.gz' | |
homepage 'http://www.jonof.id.au/kenutils' | |
md5 'ce70a9d70e08b1920e5ac88d130d0eb9' | |
version '20110722' | |
def install | |
prefix.install Dir['*'] |
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
# http://docs.rubygems.org/read/chapter/11 | |
--- | |
gem: --no-ri --no-rdoc | |
benchmark: false | |
verbose: true | |
update_sources: true | |
sources: | |
- http://gems.rubyforge.org/ | |
- http://rubygems.org/ | |
backtrace: true |
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
upstream rails { | |
server unix:///var/www/CHANGE/current/tmp/sockets/puma.sock; | |
} | |
server { | |
listen 80; | |
server_name CHANGE; | |
root /var/www/CHANGE/current/public; | |
client_max_body_size 8M; |
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 puma | |
app_path = '/var/www/YOUR_APP_NAME/current' | |
directory app_path | |
environment 'production' | |
daemonize true | |
pidfile "#{app_path}/tmp/pids/puma.pid" | |
state_path "#{app_path}/tmp/pids/puma.state" | |
stdout_redirect "#{app_path}/log/puma_error.log", "#{app_path}/log/puma_access.log", true | |
threads 0,16 |
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 | |
# Downsamples all retina ...@2x.png images. | |
# Requires `sips` to be installed | |
echo "Downsampling retina images..." | |
dir=$(pwd) | |
find "$dir" -name "*@2x.png" | while read image; do | |
outfile=$(dirname "$image")/$(basename "$image" @2x.png).png |
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
# /etc/init/sidekiq.conf - Sidekiq config | |
# This example config should work with Ubuntu 12.04+. It | |
# allows you to manage multiple Sidekiq instances with | |
# Upstart, Ubuntu's native service management tool. | |
# | |
# See workers.conf for how to manage all Sidekiq instances at once. | |
# | |
# Save this config as /etc/init/sidekiq.conf then mange sidekiq with: | |
# sudo start sidekiq index=0 |