This file contains hidden or 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
var operation = { | |
'Imperial shuttle': 5, | |
'Theta-class T-2c shuttle': 10, | |
'Sentinel-class landing craft': 2 | |
}; | |
// How many civilians can be transported in an emergency escape operation? | |
var civilians = 0; | |
for (var startship of starships) | |
if (starship.name in operation) |
This file contains hidden or 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
<div class="dropdown"> | |
<a id="{{id}}" class="dropdown-toggle {{id}}" | |
role="button" data-toggle="dropdown" data-target="#" href="#"> | |
<div class="input-group"> | |
<input type="text" class="form-control" value="{{datetime.format(dateFormat)}}"> | |
<span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span> | |
</div> | |
</a> | |
<ul ng-if="minView" class="dropdown-menu" role="menu" aria-labelledby="dLabel"> | |
<datetimepicker data-ng-model="datetime" |
This file contains hidden or 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
var ViewsCollection = require('../models/view').collection | |
var viewSvc = { | |
getByUserId(userId, cb) | |
{ | |
if (logging) $log('views.getByUserId'.trace, userId) | |
ViewsCollection.find({userId}).sort({_id:-1}).toArray((e, r) => cb(r)) | |
}, | |
getByAnonymousId(anonymousId, cb) |
This file contains hidden or 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
'use strict'; | |
var setup = require('./server/util/_setup') | |
var config = setup.initConfig(process.env.env || 'dev') | |
setup.initGlobals(config) | |
require('./index').run() |
This file contains hidden or 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
setupPostRepo(repo, githubOwner, post, readmeMD, user, cb){ | |
// console.log(`setting up repo ${repo} for ${githubOwner}`) | |
var _this = this | |
this.createRepo(repo, function(err, result){ | |
if (err){ | |
var parsedError = JSON.parse(err.message); | |
var errors = parsedError.errors | |
if (errors && errors.length == 1 && errors[0].message === "name already exists on this account") | |
$log("repo already created"); |
This file contains hidden or 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
var util = require('../../../shared/util') | |
var braintree = require('braintree') | |
var {merchantId, publicKey, privateKey} = config.payments.braintree | |
var environment = braintree.Environment[config.payments.braintree.environment] | |
var gateway = braintree.connect({ environment, merchantId, publicKey, privateKey }) | |
var logging = false |
This file contains hidden or 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
var Author = { | |
userId: { required: true, type: ObjectId, ref: 'User', index: true }, | |
name: { required: true, type: String }, | |
avatar: { required: true, type: String }, | |
username: { type: String }, // if they are an expert | |
tw: { type: String }, | |
gh: { type: String }, | |
in: { type: String }, | |
gp: { type: String }, | |
bio: { type: String } |
This file contains hidden or 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
var _JQ = document.createElement('script'); | |
_JQ.src = 'http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.2.min.js'; | |
_JQ.type = 'text/javascript'; | |
document.getElementsByTagName('head')[0].appendChild(_JQ); |
This file contains hidden or 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
users = require './../data/users' | |
data = users: [] | |
data.users.anon = authenticated: false | |
data.users.admin = users[0] | |
data.users.jk = users[1] | |
data.users.artle = users[5] | |
data.users.beountain = users[4] | |
setSession = (userKey) -> |
NewerOlder