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 ($) { | |
function img_has_loaded(imgEl) { | |
var dfd = $.Deferred(); | |
var img = new Image(); | |
img.onload = function() { | |
if (!dfd.isResolved()) | |
dfd.resolve(); | |
} |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<title> | |
</title> | |
<script type="text/javascript" src="jquery.js"></script> | |
<script type="text/javascript" src="jquery.entwine.js"></script> | |
<script type="text/javascript"> |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<title> | |
</title> | |
<script type="text/javascript" src="jquery.js"></script> | |
<script type="text/javascript" src="jquery.entwine-dist.js"></script> | |
<script type="text/javascript"> |
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() { | |
var compose = function(value, callbacks) { | |
if (typeof callbacks == 'function') | |
callbacks = [callbacks]; | |
for (var i = 0; i < callbacks.length; i++) | |
value = callbacks[i](value); | |
return value; |
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 Rectangle(left, top, width, height) { | |
this.left = left; | |
this.top = top; | |
this.width = width; | |
this.height = height; | |
this._computeCorners(); | |
} | |
Rectangle.prototype._computeCorners = function() { | |
this.bottom = this.top + this.height; |
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 mobile_redirect_form() { | |
$form = array(); | |
$form['mobile_redirect_path'] = array( | |
'#type' => 'textfield', | |
'#title' => t('Path to mobile friendly page'), | |
'#size' => 80, | |
'#maxlength' => 255, | |
'#default_value' => variable_get('mobile_redirect_path', ''), | |
'#description' => t('The path to redirect to if the user is on a mobile browser.'), | |
); |
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
require 'spec_helper' | |
describe "ActiveRecord" do | |
describe "association" do | |
it "should point to the same object" do | |
user = create(:user) | |
user.current_location.should == nil | |
user.update_location(latitude: 11, longitude: 22) | |
user.current_location.should_not == nil |
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
require 'net/ftp' | |
class FtpStorage | |
def initialize(host, username, password) | |
connect(host, username, password) | |
end | |
def connect(host, username, password) |
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
# SQLite version 3.x | |
# gem install sqlite3 | |
# | |
# Ensure the SQLite 3 gem is defined in your Gemfile | |
# gem 'sqlite3' | |
development: | |
adapter: sqlite3 | |
database: db/development.sqlite3 | |
pool: 5 | |
timeout: 5000 |
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
$data = array( | |
'name' => 'Dan B.', | |
'age' => 24, | |
'picture' => image('dan.png'), | |
'networks' => 'NYU', | |
'hometown' => 'Fresh Meadows, NY', | |
'current_city' => 'New York', | |
'college' => 'Cornell', | |
'interested_in' => 'women', | |
'relationship_status' => 'in a relationship', |
OlderNewer