Setup:
$ mongo
> use pubsub
> db.createCollection('messages', { capped: true, size: 100000 })
> db.messages.insert({})
| /** ********************************************************* | |
| * API - Model - User | |
| ********************************************************* */ | |
| module.exports = function (sequelize, DataTypes) { | |
| return sequelize.define('User', { | |
| username: DataTypes.STRING, | |
| password: DataTypes.STRING, | |
| firstName: DataTypes.STRING, | |
| lastName: DataTypes.STRING, |
| 'use strict'; | |
| // pick a random port between 1025 and 65535 | |
| // check using netstat to see if port is used | |
| var exec = require('child_process').exec; | |
| var port; | |
| var _port; | |
| var interval; |
| # Author: Pieter Noordhuis | |
| # Description: Simple demo to showcase Redis PubSub with EventMachine | |
| # | |
| # Update 7 Oct 2010: | |
| # - This example does *not* appear to work with Chrome >=6.0. Apparently, | |
| # the WebSocket protocol implementation in the cramp gem does not work | |
| # well with Chrome's (newer) WebSocket implementation. | |
| # | |
| # Requirements: | |
| # - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby |
| angular.module('appMap', ['ui.map']) | |
| .controller('MapCtrl', ['$scope', function ($scope) { | |
| $scope.mapOptions = { | |
| center: new google.maps.LatLng(37.7833, -122.4167), | |
| zoom: 13, | |
| mapTypeId: google.maps.MapTypeId.ROADMAP, | |
| disableDefaultUI: true, | |
| zoomControl: true, | |
| style: google.maps.MapTypeControlStyle.DROPDOWN_MENU | |
| }; |
| var controller = function($scope) { | |
| $scope.e = { | |
| location:"Albany, NY", | |
| locationAbout:"Try an address, a city, a place, or even latitude and longitude.", | |
| API:"", | |
| APIAbout:"You don't always need an API Key for Static Maps, but it's easy to acquire one. Without a key you might receive an error image instead of a map. Follow the link to the API Console.", | |
| zoom:13, | |
| minZoom:0, | |
| maxZoom:22, | |
| scaleAbout:"Scale will double the stated height and width. This is good for when you need a width or height larger than 640px.", |
| 'use strict'; | |
| /** | |
| * AccountController allows the User to change settings, link with their GitHub accounts, etc | |
| */ | |
| skeletonApp.controller('AccountController', [ | |
| '$scope', '$location', '$rootScope', 'OAuthService', 'ParseService', function($scope, $location, $rootScope, OAuthService, ParseService) { | |
| // redirect to "/login" if user is not logged in |
| $ = jQuery | |
| TIMEOUT = 20000 | |
| lastTime = (new Date()).getTime() | |
| setInterval -> | |
| currentTime = (new Date()).getTime() | |
| # If timeout was paused (ignoring small | |
| # variations) then trigger the 'wake' event | |
| if currentTime > (lastTime + TIMEOUT + 2000) |
| $ = jQuery | |
| queues = {} | |
| running = false | |
| queue = (name) -> | |
| name = 'default' if name is true | |
| queues[name] or= [] | |
| next = (name) -> |
| $ = jQuery | |
| TRANSFORM_TYPES = ['PUT', 'POST', 'DELETE'] | |
| $.activeTransforms = 0 | |
| $(document).ajaxSend (e, xhr, settings) -> | |
| return unless settings.type in TRANSFORM_TYPES | |
| $.activeTransforms += 1 |