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 sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2279031/hack.sh | sh | |
# |
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
function addr(arr, v, n) { | |
var steps = n === 0 ? arr.length-1 : Math.abs(n); | |
var step = n < 0 ? -1 : 1; | |
var i = n < 0 ? arr.length-1 : 0; | |
var count = arr.length-1; | |
while(count > 0 && steps > 0) { | |
console.log(arr[i]) | |
if(arr[i] === v) { | |
arr[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
[{ | |
"id": "OBxNkQ6BCHqFUQ", | |
"print_on": "2012-03-18", | |
"batch_state": "current", | |
"current": true, | |
"last_status": null, | |
"last_status_on": null, | |
"photos": [{ | |
"id": "jBPaF_rCuvHxBQ", | |
"ratio": 1.33, |
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
# I am using this for an API. So auth key is passed as user name. | |
Warden::Strategies.add(:basic) do | |
def auth | |
@auth ||= Rack::Auth::Basic::Request.new(env) | |
end | |
def store? | |
false |
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
// User | |
var PPM = { | |
user_id: 0, | |
init: function(uid){ | |
var self = this; | |
this.user_id = uid; | |
Plankton.sync('http://draw.test.envolve.com/ppmetrics/', function(data){ self.after_sync(self, data) }); | |
}, | |
after_sync: function(self, data){ |
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
source 'http://rubygems.org' | |
# Rails Gems | |
gem 'rails', :git => 'git://github.com/rails/rails.git', :branch => '3-1-stable' | |
gem 'sprockets', :git => 'git://github.com/sstephenson/sprockets.git' | |
gem 'sqlite3' | |
group :assets do | |
gem 'sass-rails', :git => 'git://github.com/rails/sass-rails.git', :branch => '3-1-stable' | |
# gem 'sass-rails', "~> 3.1.0.rc" |
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
# in config/environments/production.rb | |
# config.force_ssl = true | |
# config.middleware.use "Forcessl" | |
# Make sure redirection happens before forcing ssl | |
# config.middleware.insert_before 'Rack::SSL', 'Forcessl' | |
# in lib/forcessl.rb | |
# change *. to your domain | |
class Forcessl |
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
source :gemcutter | |
gem 'rails', '3.1.0.rc4' | |
group :assets do | |
gem 'sass-rails', "~> 3.1.0.rc" | |
gem 'coffee-script' | |
gem 'uglifier' | |
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
/usr/local/lib/ruby/1.9.1/net/http.rb:678:in `connect' | |
/usr/local/lib/ruby/1.9.1/net/http.rb:678:in `block in connect' | |
/usr/local/lib/ruby/1.9.1/timeout.rb:57:in `timeout' | |
/usr/local/lib/ruby/1.9.1/timeout.rb:87:in `timeout' | |
/usr/local/lib/ruby/1.9.1/net/http.rb:678:in `connect' | |
/usr/local/lib/ruby/1.9.1/net/http.rb:637:in `do_start' | |
/usr/local/lib/ruby/1.9.1/net/http.rb:626:in `start' | |
vendor/bundle/ruby/1.9.1/gems/rest-client-1.6.3/lib/restclient/request.rb:170:in `transmit' | |
vendor/bundle/ruby/1.9.1/gems/rest-client-1.6.3/lib/restclient/request.rb:64:in `execute' | |
vendor/bundle/ruby/1.9.1/gems/rest-client-1.6.3/lib/restclient/request.rb:33:in `execute' |
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
// USAGE | |
// @include page-curl(rgba(0,0,0,0.2), 6deg, 2deg, 0.85deg, 0px, 10px, 20px) | |
@mixin transform($scale, $rotate, $trans-x, $trans-y, $skew-x, $skew-y) | |
-moz-transform: scale($scale) rotate($rotate) translate($trans-x, $trans-y) skew($skew-x, $skew-y) | |
-webkit-transform: scale($scale) rotate($rotate) translate($trans-x, $trans-y) skew($skew-x, $skew-y) | |
-o-transform: scale($scale) rotate($rotate) translate($trans-x, $trans-y) skew($skew-x, $skew-y) | |
-ms-transform: scale($scale) rotate($rotate) translate($trans-x, $trans-y) skew($skew-x, $skew-y) | |
transform: scale($scale) rotate($rotate) translate($trans-x, $trans-y) skew($skew-x, $skew-y) |