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
onRender: function() { | |
var filter = this.options.filter || this.filter; | |
var view= new ListView({collection: TitanFile.channelList, filter: filter}); | |
var contentPromise = this.content.show(view); | |
return contentPromise; | |
} |
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
Backbone.serverSync = Backbone.sync; | |
Backbone.pingUrl = '/Ping'; | |
Backbone.localID = function() { | |
var localID = (localStorage.localID ? parseInt(localStorage.localID) : 0); | |
localID++; | |
localStorage.localID = localID.toString() | |
return -localID; | |
} |
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>Capture Photo</title> | |
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1"/> | |
<script type="text/javascript" charset="utf-8" src="js/phonegap.js"></script> | |
<script type="text/javascript" charset="utf-8"> | |
var pictureSource; // picture source | |
var destinationType; // sets the format of returned 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
class Api::SessionsController < Devise::SessionsController | |
# include Devise::Controllers::InternalHelpers | |
prepend_before_filter :require_no_authentication, :only => [:new, :create] | |
def new | |
super | |
end | |
def create | |
sign_out(current_user) if current_user |
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 IamConnect.Collections.Locations extends Backbone.Collection | |
url: '/api/locations' | |
model: IamConnect.Models.Location | |
_.extend IamConnect.Collections.Locations.prototype, IamConnect.Mixins.PaginationCollectionMethods.prototype |
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
# Install PostgreSQL and PostGIS Via Homebrew | |
# One click installer seems to fail to get PostGIS installed. | |
# Download GISGraphy Binaries from http://www.gisgraphy.com/download/ | |
# Move unzipped directory into /src/gisgraphy | |
# INITIALIZE TABLES | |
psql -U postgres -d gisgraphy -h 127.0.0.1 -f /src/gisgraphy/sql/create_tables.sql |
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
# Some good references are: | |
# http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x | |
# http://www.paolocorti.net/2008/01/30/installing-postgis-on-ubuntu/ | |
# http://postgis.refractions.net/documentation/manual-1.5/ch02.html#id2630392 | |
#1. Install PostgreSQL postgis and postgres | |
brew install postgis | |
initdb /usr/local/var/postgres | |
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start |
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 'rubygems' | |
require 'mechanize' | |
BASE = 'http://manure.myshopify.com/admin' | |
LOGIN = '/auth/login' | |
USER = 'paddy@cow.com' | |
PWD = 'moo-moo' | |
agent = Mechanize.new | |
page = agent.get(BASE+LOGIN) | |
form = page.forms.first | |
form.login = USER |
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
# First configure your models to use Amazon s3 as storage option and setup the associated S3 config. | |
# Then add the classes your want to migrate in the klasses array below. | |
# Then run rake paperclip_migration:migrate_to_s3 | |
# Should work but this is untested and may need some tweaking - but it did the job for me. | |
namespace :paperclip_migration do | |
desc "migrate files from filesystem to s3" | |
task :migrate_to_s3 => :environment do | |
klasses = [:model_1, :model_2] # Replace with your real model names. If anyone wants to this could be picked up from args or from configuration. | |
klasses.each do |klass_key| |
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
<% | |
if menu_branch.title.nil? | |
css = "class='nil'" | |
elsif !!local_assigns[:apply_css] and (classes = css_for_menu_branch(menu_branch, menu_branch_counter, sibling_count||=nil, collection, selected_item ||= nil)).any? | |
css = "class='#{menu_branch.title.underscore.gsub(" ","_")} #{classes.join(' ')}'" | |
else | |
css = "class='#{menu_branch.title.underscore.gsub(" ","_")}'" | |
end | |
dom_id = ("id='item_#{menu_branch_counter}'" if menu_branch.parent_id.nil? and menu_branch.title.present?) |
NewerOlder