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 | |
function printHelpAndExit { | |
echo 'Usage:' | |
echo ' gifify -coux filename' | |
echo '' | |
echo 'Options: (all optional)' | |
echo ' c CROP: The x and y crops, from the top left of the image, i.e. 640:480' | |
echo ' o OUTPUT: The basename of the file to be output (default "output")' | |
echo ' u: Upload the resulting image to CloudApp' |
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
name=gifify_`date +%s` | |
echo -ne $name | pbcopy | |
osascript <<EOF | |
tell application "System Events" | |
set visible of process "Terminal" to false | |
end tell | |
tell application "QuickTime Player" | |
activate |
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 | |
remote: git://github.com/searls/jasmine-rails.git | |
revision: 1f7991488103d58b927b1736394afedb21c7aede | |
specs: | |
jasmine-rails (0.3.2) | |
jasmine (~> 1.3) | |
jasmine-headless-webkit | |
rails (>= 3.1.0) | |
GEM |
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
alive_sec = (Time.now - start_time).to_i | |
worker_pid = Process.pid | |
@@kill_attempts ||= 0 | |
sig = :QUIT | |
sig = :TERM if @@kill_attempts > configuration.max_quit | |
sig = :KILL if @@kill_attempts > configuration.max_term | |
logger.warn "#{self} send SIG#{sig} (pid: #{worker_pid}) alive: #{alive_sec} sec (trial #{i})" | |
Process.kill sig, worker_pid |
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 self.kill_self(logger, start_time) | |
alive_sec = (Time.now - start_time).to_i | |
worker_pid = Process.pid | |
@@kill_attempts ||= 0 | |
sig = :QUIT | |
sig = :TERM if @@kill_attempts > configuration.max_quit | |
sig = :KILL if @@kill_attempts > configuration.max_term | |
logger.warn "#{self} send SIG#{sig} (pid: #{worker_pid}) alive: #{alive_sec} sec (trial #{i})" |
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 self.kill_self(logger, start_time) | |
alive_sec = (Time.now - start_time).to_i | |
worker_pid = Process.pid | |
@@kill_attempts ||= 0 | |
@@kill_attempts += 1 | |
sig = :QUIT | |
sig = :TERM if @@kill_attempts > configuration.max_quit | |
sig = :KILL if @@kill_attempts > configuration.max_term |
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
$.turbobind -> | |
$('.element').on 'click', (e) -> | |
console.log('woohoo!') |
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 Pet < ActiveRecord::Base | |
belongs_to :person | |
end | |
class Person < ActiveRecord::Base | |
has_many :pets do | |
def names | |
collect(&:name) | |
end | |
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
#!/bin/bash | |
function printHelpAndExit { | |
echo 'Usage:' | |
echo ' gifify -conx filename' | |
echo '' | |
echo 'Options: (all optional)' | |
echo ' c CROP: The x and y crops, from the top left of the image, i.e. 640:480' | |
echo ' o OUTPUT: The basename of the file to be output (default "output")' | |
echo ' n: Do not upload the resulting image to CloudApp' |
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
$ -> | |
$('img[data-retina]').each -> | |
if window.devicePixelRatio > 1 | |
src = $(this).attr('src') | |
retinaSrc = src.replace /(\.[a-z]+$)/, "@2x$1" | |
$(this).attr('src', retinaSrc) |
OlderNewer