Skip to content

Instantly share code, notes, and snippets.

View omgitsads's full-sized avatar
:shipit:

Adam Holt omgitsads

:shipit:
View GitHub Profile
# 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:
[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
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
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]
})
class String
def strip_test
strip
end
end
"string ".strip_test
# => "string"
class String
# Application
class App < Sinatra::Base
set :hi, "Hello"
configure :test do
set :hi, "Hello There!"
end
end
# Registering a extention
function Something(){
function iAmPrivate(){
sys.puts("Hello from a private method");
}
}
Something.prototype.public = function(){
iAmPrivate();
sys.puts("Hello from public method");
}
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])
@omgitsads
omgitsads / after_symlink.rb
Created August 23, 2011 12:16 — forked from tjl2/after_symlink.rb
Engine Yard after_symlink deploy hook
Foursquare *foursquare = [[Foursquare alloc] initWithAccessToken:accessToken];
[foursquare getUserwithCallback:^(BOOL success, id result){
if (success) {
NSLog(@"%@", (NSDictionary*)result);
} else {
NSLog(@"%@", [(NSError *)result localizedDescription]);
}
}];