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
### | |
Module dependencies | |
### | |
require.paths.unshift "#{__dirname}/lib/support/express-csrf/" | |
require.paths.unshift "#{__dirname}/lib/support/node_hash/lib/" | |
express = require 'express' | |
app = module.exports = express.createServer() | |
RedisStore = require 'connect-redis' |
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
// includes bindings for fetching/fetched | |
var PaginatedCollection = Backbone.Collection.extend({ | |
initialize: function() { | |
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage'); | |
typeof(options) != 'undefined' || (options = {}); | |
this.page = 1; | |
typeof(this.perPage) != 'undefined' || (this.perPage = 10); | |
}, | |
fetch: function(options) { |
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
# before this file is loaded, a locale should be set: | |
# | |
# In a browser environment, you can use: | |
# ```<script>__locale='en';</script>``` | |
# | |
# In a server environment (specifically node.js): | |
# ```global.__locale = 'en';``` | |
# normalize in-app locale string to "en" or "de-AT" | |
parts = @__locale.split('-') |
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
// Responsive layouts in stylus | |
// https://gist.github.com/1549029 | |
// Created by Benjamin Lupton | |
// Licensed under the Creative Commons Zero - http://creativecommons.org/publicdomain/zero/1.0/ | |
// ==================================== | |
// Imports | |
// Nib | |
@import 'nib' |
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
// Based on getskeleton.com | |
@import "nib/clearfix" | |
@import "nib/reset" | |
global-reset() | |
columns = 16 | |
column-width = 57px // Ends up as 1232px layout | |
gutter-width = 20px |
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 | |
* @file /app/helpers/models.js | |
**/ | |
Spine.Model.extend({ | |
toJSON: function(){ | |
var attributes = this.attributes(); | |
attributes['id'] = attributes['_id']; | |
return attributes; |
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
/* Smartphones (portrait and landscape) ----------- */ | |
@media only screen | |
and (min-device-width : 320px) | |
and (max-device-width : 480px) { | |
/* Styles */ | |
} | |
/* Smartphones (landscape) ----------- */ | |
@media only screen | |
and (min-width : 321px) { |
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
NameError: uninitialized constant Product | |
from /home/dasssss/.rvm/gems/ruby-1.9.3-p0@global/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:230:in `block in constantize' | |
from /home/dasssss/.rvm/gems/ruby-1.9.3-p0@global/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:229:in `each' | |
from /home/dasssss/.rvm/gems/ruby-1.9.3-p0@global/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:229:in `constantize' | |
from /home/dasssss/.rvm/gems/ruby-1.9.3-p0@global/gems/activesupport-3.2.8/lib/active_support/core_ext/string/inflections.rb:54:in `constantize' | |
from /home/dasssss/.rvm/gems/ruby-1.9.3-p0@2mato/gems/mongoid-3.0.6/lib/mongoid/relations/metadata.rb:606:in `klass' | |
from /home/dasssss/.rvm/gems/ruby-1.9.3-p0@2mato/gems/mongoid-3.0.6/lib/mongoid/relations/proxy.rb:21:in `klass' | |
from /home/dasssss/.rvm/gems/ruby-1.9.3-p0@2mato/gems/mongoid-3.0.6/lib/mongoid/relations/referenced/one.rb:21:in `block in initialize' | |
from /home/dasssss/.rvm/gems/ruby-1.9.3-p0@2mato/gems |
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 'tilt' | |
class HandlebarsTemplate < Tilt::Template | |
def initialize_engine | |
return if defined?(Handlebars) | |
require 'handlebars' | |
end | |
def prepare | |
@template = Handlebars.compile(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
grunt.initConfig({ | |
hogan: { | |
// desired target name | |
dev : { | |
// indicate you want to compile templates | |
compile : { | |
// wildcard of desired templates (glob syntax) | |
templates : "source/**/*.mustache", | |
processName: function(filename) { | |
return filename.replace(/source\//, "").replace(/\.jst\.mustache/, ""); |
OlderNewer