Skip to content

Instantly share code, notes, and snippets.

View shinecita's full-sized avatar

Caro Urquhart shinecita

View GitHub Profile
angular
.module('myApp', ['myApp.controllers'])
.controller('PostController',require('./controllers/posts'))
.config(function($routeProvider, $locationProvider) {
$locationProvider.html5Mode(true);
$routeProvider
.when('/', {templateUrl: 'index', controller: PostController})
.when('/posts/:postId', {templateUrl: 'posts/show', controller: require('./controllers/posts')})
.otherwise({redirectTo:'/'});
@shinecita
shinecita / index.js
Created December 13, 2012 19:52
This is the index.js
var Debug = require('debug')
, debug = Debug('router');
require('./controllers');
angular
.module('myApp', ['myApp.controllers'])
.config(function($routeProvider, $locationProvider) {
$locationProvider.html5Mode(true);
{
"name": "flint",
"repo": "Igniter/guata",
"description": "Life is a journey",
"version": "0.0.1",
"keywords": [],
"dependencies": {
"visionmedia/debug": "*",
"component/emitter": "*",
"deedubs/throttle": "*",
<script type="text/javascript" src = "http://maps.googleapis.com/maps/api/js?libraries=places&key=AIzaSyBai0Pn63gLIaI1AlBpSWuCg6IT2CxpRRw&sensor=true"></script>
db.users.find({email : "[email protected]" });
{ "__neoId" : "173", "__password" : { "salt" : "0XjwgeB4zvYVZe68uScObWskpmdbj7ZVVUCdD0pchEuDQFnQh1Q1QYRUGQ3aFNG24tuwqtITde4+mYgHbDs+h88Y4bfpcl8y2mxq++e3LSffbH/vfZP29GPZd8/1f37Ouh1qB5AODlXKaO2bL6YXi4dN4U7AJVJF0m4FQcBoajA=", "hash" : "…ÐÕ€ÓŸí¬ž„1j\u000b©j\u0017ü|Yðøzt²3šÀ*UjF5ôÁl+\u0014Vpž\u0010\u001aªý°âyN³öŽ‘;…©°:N˜ ¾¯‰çì¥ª¨¥ö?g\u001bX«ûY\u0001®.”Rÿ\u001f+ݐmF\u0004\rhQrú¬n\u0017źA¢\u001c\u0010XX\u001f0\nv\u0002RٟW§\u0006aï ;+°·ø" }
, "_id" : ObjectId("50b62cb856d488de3e000001")
, "description" : null
, "email" : "[email protected]"
, "homeBase" : null
, "invitationsCount" : 2
, "joinedAt" : ISODate("2012-11-29T18:53:37.475Z")
, "name" : "Carolina Urquhart"
@shinecita
shinecita / gist:4170844
Created November 29, 2012 18:09
weekly
<p>Hi there #{user.name}!<p>
<p>This week in the socialsca.pe we welcomed #{newUsers.length} new members.</p>
<p>Below you'll see a short list of those we think you might be most interested in.</p>
<p>To keep improving these recommendations, try updating your profile and </p>
<a href="#{url+ '/invite'}">add more friends and colleagues </a>to the <a href="#{url}">socialsca.pe.</a>
if invited && invited.length > 0
#{invited.length} member(s) that you invited have now joined
</p>
, Email = require('starscape-email')
var options = {
template: "weeklyEmail.template",
locals: { newUsers: "3", stats : "x"}, //TODO Load stats
subject: weeklyEmail.subject,
from : weeklyEmail.from,
category: weeklyEmail.category
};
var sha = crypto.createHash('sha1');
sha.update((new Date()).toString() + invitedUser.email);
invitedUser.token = sha.digest('hex');
User.save(invitedUser, function (err, invitedUser) {
User.addOrganizations(invitedUser, organizations, function() {
callback(err, invitedUser);
});
router.post('/signin', function (req, res) {
User
.findOne({ email: req.body.email }, function(err, user) {
if(user && user.__password.salt) {
pass.hash(req.body.password, user.__password.salt, function(err, hash) {
if(user.__password.hash == hash) {
req.session._userId = user._id;
res.json(user);
} else {
res.send(401);
@shinecita
shinecita / gist:4059847
Created November 12, 2012 15:01
do not updatebouds
Map.focus = function (object, zoomLevel) {
Map.clearLines();
var location = object && object.location();
if (location) {
Map.$map.panTo(location);
// Map.$map.setZoom(zoomLevel || 10);
}