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
name: Node CI/CD | |
on: | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master |
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 loki = require('lokijs'); | |
var logger = require('colog'); | |
var Tasks = (function () { | |
function Tasks() { | |
if (Tasks.instance) { | |
return Tasks.instance; | |
} | |
this.taskDb = new loki('db/tasks.json', { autosave: true, autoload: true, autosaveInterval: 5000, autosaveCallback: function () { logger.info('autosaved db'); } }); | |
if (!this.taskDb.getCollection('tasks')) { | |
this.taskDb.addCollection('tasks', { indices: ['name'] }); |
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
function getBlogPosts(url, count, callback) { | |
if (!count || count <= 0) { count=1; } | |
if (!url) { url = window.location.protocol + '//' + window.location.host; } | |
else if (url.charAt(url.length-1) === '/') { url = url.substr(0, url.length-1); } | |
if (!callback || typeof callback !== 'function') { callback = function(data){console.dir(data);} } | |
$.getJSON(url + "/feed/json/?callback=?", function(data){ | |
if (data.length === 0) { throw "No recognized data returned!"; } | |
var posts = []; |