Skip to content

Instantly share code, notes, and snippets.

View lykmapipo's full-sized avatar

lally elias lykmapipo

View GitHub Profile
@lykmapipo
lykmapipo / dia_comment_width_fix.md
Created November 26, 2015 09:27
Fixing height of comment section of dia diagram tool in ubuntu

I have fixed it by editing the start script /usr/bin/dia to have the LIBOVERLAY_SCROLLBAR=0 before the dia launch.

$ sudo /usr/bin/dia

Then edit dia file to look as below

@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 / 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 / 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 / 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
@jmdobry
jmdobry / app.js
Last active May 16, 2018 18:16
js-data + js-data-firebase + js-data-localstorage
var fb = new DSFirebaseAdapter({
basePath: 'https://my-app.firebase.io'
});
var ls = new DSLocalStorageAdapter();
var store = new JSData.DS({
// try firebase first, otherwise try offline data
fallbackAdapters: ['fb', 'ls'],
// After creating an item, sync it to localStorage
@jmdobry
jmdobry / DSCustomAdapter.js
Created September 25, 2014 15:53
Creating custom adapters for angular-data
angular.module('myApp').provider('DSCustomAdapter', function () {
'use strict';
var defaults = this.defaults = {
queryTransform: function (resourceName, params) {
return params;
}
};
@mlynch
mlynch / directive.markdown
Last active July 31, 2017 14:37
Making of an AngularJS Directive

A while back I made a quick AngularJS directive for Bootstrap 3 Tooltips. I wanted to be able to specify tooltips on any element like this:

<button title="Settings" data-placement="bottom" data-delay="500"
data-toggle="tooltip"><i class="icon ion-gear"></i></button>

But I wanted to be able to do it without having to call $([data-toggle="tooltip"]').tooltip() every time I loaded a new page with tooltips, which is what you'd have to do if you were using vanilla jQuery and Bootstrap without something like Angular.

I built a really simple directive that worked perfectly, and I realized this was a perfect example of creating a simple custom directive that makes your life so much easier.

@mdunisch
mdunisch / How you get Sail.js running on Openshift.md
Last active July 13, 2023 14:51
Get Sails.js running on Openshift

#How you get Sail.js running on Openshift#

This instruction is tested with:

  • Sails.js v0.9.16
  • Node.js 0.10 on Openshift ( 05 May 2014)

###1) package.json

If you use the package.json build by sails new Projectname than you have to add a few fields for openshift – so the server can start you app automatically. Sails uses Grunt to build minify css/js and so on. Openshift dont have grunt installed so you have to add this also.

@demisx
demisx / angularjs-providers-explained.md
Last active May 17, 2024 03:38
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