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
[debug] application - Got dbo: { "className" : "com.mls.iapi.SetStoryCoverRequest" , "params" : { "className" : "com.mls.iapi.SetStoryCover" , "storyId" : { "$oid" : "512f5c7103641c73a5397c63"} , "newCover" : { "$oid" : "512f3b2c44ae322f6b49c82f"}}} | |
[debug] application - Skipping conversion of `effectiveAccountId` field | |
[debug] application - Restored dbo to request { "effectiveAccountId" : null , "params" : { "storyId" : { "$oid" : "512f5c7103641c73a5397c63"} , "newCover" : { "$oid" : "512f3b2c44ae322f6b49c82f"} , "className" : "com.mls.iapi.SetStoryCover"} , "className" : "com.mls.iapi.SetStoryCoverRequest"} | |
[debug] application - Account in session: { "birthday" : null , "emailVerified" : false , "location" : null , "email" : "[email protected]" , "master" : true , "accountName" : "Noel" , "_id" : { "$oid" : "512f5c5503641c73a5397c50"} , "discoverable" : true , "ACL" : { } , "siteURL" : null , "lastName" : null , "firstName" : null , "phoneVerified" : false , "nikname" : null , "className" : "com.ml |
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
app.directive('contenteditable', function () { | |
return { | |
require: 'ngModel', | |
link: function (scope, elm, attrs, ctrl) { | |
// clear paste data | |
elm.bind('paste', function(e){ | |
setTimeout(function() { | |
scope.$apply(function() { | |
ctrl.$setViewValue(e.target.innerText); | |
}); |
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
var items = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; | |
var id_array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; | |
var union = function (p, q) { | |
var pId = id_array[p]; | |
var qId = id_array[q]; | |
if (items[p] === items[q]) { | |
return; |
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
var items = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; | |
var parent = []; | |
var size = []; | |
for (i = 0; i < items.length; ++i){ | |
parent[i] = i; | |
size[i] = 1; | |
} |
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
var json = $( "form" ).serializeArray(); | |
$.each( json, function( index, elem ){ | |
$( "[name='" + elem.name + "']" ).val( elem.value ); | |
}); |
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
/* | |
Write a loop that makes seven calls to console.log to output the following triangle: | |
# | |
## | |
### | |
#### | |
##### | |
###### | |
####### | |
*/ |
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
/* | |
Write a program that uses console.log to print all the numbers from 1 to 100, | |
with two exceptions. For numbers divisible by 3, print "Fizz" instead of the number, | |
and for numbers divisible by 5 (and not 3), print "Buzz" instead.” | |
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators | |
*/ | |
for (var n = 1; n <= 100; n++) { | |
var output = ""; | |
if (n % 3 == 0) |
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
var size = 8; | |
var board = ""; | |
for (var y = 0; y < size; y++) { | |
for (var x = 0; x < size; x++) { | |
if ((x + y) % 2 == 0) | |
board += " "; | |
else | |
board += "#"; |
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
// Copyright (c) 2014 The Chromium Authors. All rights reserved. | |
// Use of this source code is governed by a BSD-style license that can be | |
// found in the LICENSE file. | |
(function() { | |
'use strict'; | |
/** | |
* T-Rex runner. | |
* @param {string} outerContainerId Outer containing element id. | |
* @param {Object} opt_config | |
* @constructor |
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
var mustache = require("mustache"); | |
var fs = require("fs"); | |
fs.readFile("app/views/index.mustache", function (err, data) { | |
if (err) throw err; | |
var output = mustache.render(data.toString(), {}); | |
fs.writeFile('public/index.html', output, function (err) { | |
if (err) throw err; | |
}); |
OlderNewer