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
# This needs to match | |
# Results: | |
# Result 1 | |
# "<p>{{if something > something_else}}</p>\n<p>Show some content</p>\n<p>{{end}}</p>" | |
<p>{{if something > something_else}}</p> | |
<p>Show some content</p> | |
<p>{{end}}</p> | |
# As does this, also 3 paragraphs, 4 paragraphs, 5 para.... | |
# Results: |
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
[Thu Jun 18 16:41:11 2009] [warn] Init: Session Cache is not configured [hint: SSLSessionCache] | |
sh: mkdir: command not found | |
[Thu Jun 18 16:41:11 2009] [error] *** Passenger could not be initialized because of this error: Cannot create directory '/tmp/passenger.18524' | |
sh: mkdir: command not found | |
[Thu Jun 18 16:41:11 2009] [error] *** Passenger could not be initialized because of this error: Cannot create directory '/tmp/passenger.18524' | |
[Thu Jun 18 16:41:11 2009] [notice] Digest: generating secret for digest authentication ... | |
[Thu Jun 18 16:41:11 2009] [notice] Digest: done | |
[Thu Jun 18 16:41:11 2009] [notice] Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.7l DAV/2 Phusion_Passenger/2.2.2 configured -- resuming normal operations |
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 SecureController < ApplicationController | |
layout 'secure' | |
def booking | |
@secure = Secure.find(:first, :conditions=>{ :email=>params[:secure][:email], :reference=>params[:secure][:reference]}) | |
redirect_to secure_booking2_path and return if not @secure.nil? | |
flash[:warning]="Booking not found" | |
@secure = Secure.new | |
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
class SecureController < ApplicationController | |
layout 'secure' | |
def booking | |
@secure = Secure.new | |
return unless request.post? | |
@secure = Secure.find(:first, :conditions => { | |
:email => params[:secure][:email], | |
:reference => params[:secure][:reference] | |
}) |
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 strip_test | |
strip | |
end | |
end | |
"string ".strip_test | |
# => "string" | |
class String |
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
# Application | |
class App < Sinatra::Base | |
set :hi, "Hello" | |
configure :test do | |
set :hi, "Hello There!" | |
end | |
end | |
# Registering a extention |
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 Something(){ | |
function iAmPrivate(){ | |
sys.puts("Hello from a private method"); | |
} | |
} | |
Something.prototype.public = function(){ | |
iAmPrivate(); | |
sys.puts("Hello from public method"); | |
} |
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 convert_to_literal_object(a) { | |
var o = {}; | |
for(var i=0;i<a.length;i++) { | |
o[a[i]]=''; | |
} | |
return o; | |
} | |
object = convert_to_literal_object([1,2,3,4]) |
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
on_app_servers do | |
run("mkdir -p #{shared_path}/config/thinkingsphinx") | |
run("ln -nfs #{shared_path}/config/thinkingsphinx #{release_path}/config/thinkingsphinx") | |
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
Foursquare *foursquare = [[Foursquare alloc] initWithAccessToken:accessToken]; | |
[foursquare getUserwithCallback:^(BOOL success, id result){ | |
if (success) { | |
NSLog(@"%@", (NSDictionary*)result); | |
} else { | |
NSLog(@"%@", [(NSError *)result localizedDescription]); | |
} | |
}]; |
OlderNewer