Skip to content

Instantly share code, notes, and snippets.

View lykmapipo's full-sized avatar

lally elias lykmapipo

View GitHub Profile
@lykmapipo
lykmapipo / nodejs_env_setup.md
Last active August 29, 2015 14:18
Nodejs Environment Setup

nodejs development environment setup

Update ubuntu

$ sudo apt-get update

Install curl

$ sudo apt get install curl
var kue = require('kue'),
jobs = kue.createQueue(),
util = require('util'),
noop = function() {};
jobs.CLEANUP_MAX_FAILED_TIME = 30 * 24 * 60 * 60 * 1000; // 30 days
jobs.CLEANUP_MAX_ACTIVE_TIME = 1 * 24 * 60 * 60 * 1000; // 1 day
jobs.CLEANUP_MAX_COMPLETE_TIME = 5 * 24 * 60 * 60 * 1000; // 5 days
jobs.CLEANUP_INTERVAL = 5 * 60 * 1000; // 5 minutes
@lykmapipo
lykmapipo / mongoose_single_document_inheritance.js
Last active August 29, 2015 14:20
Mongoose Single Document Inheritance
'use strict';
//dependencies
var mongoose = require('mongoose');
var util = require('util');
var Schema = mongoose.Schema;
var async = require('async');
//Base Journal Entry Schema
function JournalEntry() {
@lykmapipo
lykmapipo / isomorphic_javascript_software_engineer.md
Last active January 26, 2016 16:05
Isomorphic Javascript Software Engineer

MEAN Developer

Isomorphic Javascript Software Engineer

Ubuntu Setup

Version management tool

Dependency management tools

@lykmapipo
lykmapipo / mocha_as_cukes.md
Last active August 29, 2015 14:23
Mocha as Cucumber
Feature: get cash from an ATM
  Background:
    Given the ATM has 1000
    And the user John is authenticated
    And the user's account has 5000
  Scenario: success
    When the user asks the ATM for 500
    Then the ATM will have 500
    And the user's account will have 4500
@lykmapipo
lykmapipo / storeImgInMongoWithMongoose.js
Last active November 8, 2015 17:29 — forked from aheckmann/storeImgInMongoWithMongoose.js
store/display an image in mongodb using mongoose/express
/**
* Module dependencies
*/
var express = require('express');
var fs = require('fs');
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
// img path
@lykmapipo
lykmapipo / phantomjs-facebook-update.js
Last active August 30, 2018 18:52 — forked from ariefbayu/phantomjs-facebook-update.js
facebook status update using phantomjs
var page = new WebPage();
//spoof it as opera mini, to get the mobile page working properly
page.settings.userAgent = "Opera/9.80 (J2ME/MIDP; Opera Mini/6.5.26955/27.1407; U; en) Presto/2.8.119 Version/11.10";
function doLogin(){
page.evaluate(function(){
var frm = document.getElementById("login_form");
frm.elements["email"].value = "--enter-your-email--";
cordova plugin add https://github.com/brodysoft/Cordova-SQLitePlugin.git
@lykmapipo
lykmapipo / app.js
Last active December 19, 2019 20:29 — forked from jgoux/app.js
Ionic / AngularJS service wrapper for Web SQL API / SQLite-Cordova-Plugin
angular.module('myApp', ['ionic', 'myApp.services', 'myApp.controllers'])
.run(function(DB) {
DB.init();
});
@lykmapipo
lykmapipo / angularjs-providers-explained.md
Last active August 29, 2015 14:26 — forked from demisx/angularjs-providers-explained.md
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant