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
public class UsersContext : DbContext | |
{ | |
public UsersContext() | |
: base("cf5WebContext") | |
{ | |
} | |
public DbSet<UserProfile> UserProfiles { get; set; } | |
} |
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
WebSecurity.InitializeDatabaseConnection("fbRealtimeWebContext", "UserProfile", "UserId", "UserName", autoCreateTables: true); |
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
public class WebApplication : System.Web.HttpApplication | |
{ | |
protected void Application_Start() | |
{ | |
RouteTable.Routes.MapRoute("HttpProxy", "proxy/{*path}", new { controller = "Proxy", action = "Http" }) | |
} | |
} |
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
Template.hacks_detail.hack = -> Hacks.findOne({ _id : Session.get('hack_id') }) | |
Template.hacks_detail.creatorName = -> | |
owner = Meteor.users.findOne @owner | |
if owner then displayName(owner) else '' |
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
<head> | |
<title>Your meteor app</title> | |
</head> | |
<body> | |
{{> setup}} | |
</body> | |
<template name="setup"></template> |
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 FilteringAndPagingCollection extends Collection | |
pagesize: 25 # overriden in the child class | |
constructor: (args) -> | |
Backbone.Collection.prototype.constructor.apply(@, arguments) # called so backbone wires up & calls initialize | |
@filteredmodels = @models | |
@on 'reset', @resetfilteredmodels, @ # if the collection is reset, we need to reset the filtered version too | |
@on 'search sort', @resetpaging, @ | |
resetfilteredmodels: -> | |
@filteredmodels = @models | |
@resetpaging() |
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
exports.config = | |
files: | |
javascripts: | |
joinTo: | |
'javascripts/app.js': /^app/ | |
'javascripts/vendor.js': /^vendor/ | |
'test/javascripts/test.js': /^test[\\/](?!vendor)/ | |
'test/javascripts/test-vendor.js': /^test[\\/](?=vendor)/ | |
order: | |
before: [ |
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
render_carousel: -> | |
@$('.carousel-images').append('<img src="'+img.url+'">') for img in images |
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
""" FilteringCollection | |
(1) Holds an original AND a filtered view of it's models | |
(2) Can sort filtered models on any arbitrary attribute | |
- sort can be invoked multiple times with different attributes to get | |
sorted by A then B """ | |
class FilteringCollection extends Backbone.Collection | |
# Use coffee's constructor function so we can enforce initialization code + | |
# let the child class use the standard Backbone initialize function to |
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
mongoose = require 'mongoose' | |
wipeDbAfterTests = true | |
describe "Your test suite", -> | |
# connect to our mongo test database, note how done is passed to mongoose connect | |
before (done) -> | |
mongoose.connect "mongodb://localhost/airpair_test", done |
OlderNewer