Install Python
$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7
Symlinks...
| require 'prawn' | |
| Prawn::Document.generate('crop-marks.pdf') do | |
| spacing = 12 | |
| margin = 100 | |
| canvas do | |
| # topleft corner | |
| stroke_line [bounds.left + spacing, bounds.top - margin], | |
| [bounds.left + margin - spacing, bounds.top - margin] |
| $(document).ready(function(){ | |
| $("a.tab").live('click', function () { | |
| $(".content").hide(); | |
| $("ul.tabs .active").removeClass("active"); | |
| $(this).addClass("active"); | |
| $("#" + $(this).attr("title")).show(); | |
| }); |
| framework 'Cocoa' | |
| class NSColor | |
| def toCGColor | |
| color_RGB = colorUsingColorSpaceName(NSCalibratedRGBColorSpace) | |
| ## approach #1 | |
| # components = Array.new(4){Pointer.new(:double)} | |
| # color_RGB.getRed(components[0], | |
| # green: components[1], | |
| # blue: components[2], |
| #!/usr/local/bin/macruby | |
| framework 'Cocoa' | |
| framework 'QuartzCore' | |
| class FireworkDelegate | |
| attr_accessor :window | |
| def initWithURL(url) | |
| case url | |
| when String | |
| @firework_photo_url = NSURL.URLWithString(url) |
| # If you're getting this error trying to use ApacheBench on OS X Lion: | |
| # Benchmarking mwmanning.com (be patient)...apr_socket_recv: Connection reset by peer (54) | |
| # | |
| # You need to download the latest beta version of Apache and rebuild ab. | |
| # Here's how (assuming you have homebrew installed). | |
| # Install Homebrew (https://github.com/mxcl/homebrew) and then the Perl Regex support | |
| brew install pcre | |
| # Download the latest from http://httpd.apache.org/download.cgi, then decompress and compile it |
| #!/bin/bash | |
| set -u | |
| set -e | |
| #change this below to your actual path. If you another environemnt like staging, fucking change N to -e staging instead. | |
| APP_PATH=/youpath/to/app/root | |
| PID=$APP_PATH/tmp/pids/unicorn.pid | |
| OLD_PID=$APP_PATH/tmp/pids/unicorn.pid.oldbin | |
| UNICORN_COMMAND="unicorn_rails -c $APP_PATH/config/unicorn.rb -D" | |
| while getopts ":nsNr" opt; do |
| @media only screen and (-webkit-device-pixel-ratio: .75) { | |
| /* CSS for Low-density Android screens goes here * | |
| * Ex: HTC Evo, HTC Incredible, Nexus One */ | |
| } | |
| @media only screen and (-webkit-device-pixel-ratio: 1) and (max-device-width: 768px) { | |
| /* CSS for Medium-density Android screens goes here * | |
| * Ex: Samsung Ace, Kindle Fire, Macbook Pro * | |
| * max-device-width added so you don't target laptops and desktops */ | |
| } |
| jQuery(function($) { | |
| $('form[data-async]').live('submit', function(event) { | |
| var $form = $(this); | |
| var $target = $($form.attr('data-target')); | |
| $.ajax({ | |
| type: $form.attr('method'), | |
| url: $form.attr('action'), | |
| data: $form.serialize(), |
| gifify() { | |
| if [[ -n "$1" ]]; then | |
| if [[ $2 == '--good' ]]; then | |
| ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
| time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif | |
| rm out-static*.png | |
| else | |
| ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif | |
| fi | |
| else |
Install Python
$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7
Symlinks...