Skip to content

Instantly share code, notes, and snippets.

View lykmapipo's full-sized avatar

lally elias lykmapipo

View GitHub Profile

#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.

@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 / angular_error_interceptor.js
Created December 10, 2015 07:57
Sample snippets to handle angular http errors
.config(function($httpProvider) {
$httpProvider.interceptors.push(['$q', '$rootScope', function($q, $rootScope) {
return {
responseError: function(rejection) {
if (rejection.status === 403) {
$rootScope.$broadcast('403', rejection);
}
return $q.reject(rejection);
}
};
@lykmapipo
lykmapipo / ChromePackagedApps.md
Created December 29, 2015 09:09
Chrome Packaged Apps

##Chrome Packaged Apps

Introduction

Introduced at Google I/O 2012, Chrome packaged apps are a new way to develop apps that are running 'natively' within Chrome on the desktop as well as on Chrome mobile in the near future. I'm currently in the middle of a project where I develop a Chrome packaged app and in this article I would like to share my experience with the development of packaged apps.

Please note: This article should give you a basic insight of topics that I think are helpful to know for developing packaged apps. Furthermore I will give links to each topic, so you can dive deeper into that specific topic if you want to. It's not the goal of this article to act as a complete introduction to Chrome packaged apps, for a much more detailed overview of packaged apps development, please look at the official packaged app documentation.

What are Chrome Packaged Apps

Chrome packaged apps are applic

@lykmapipo
lykmapipo / ChromeExtensionGulp.js
Created December 29, 2015 18:04 — forked from TravelingTechGuy/ChromeExtensionGulp.js
Gulp file for building a Chrome Extension
'use strict';
//npm install gulp gulp-minify-css gulp-uglify gulp-clean gulp-cleanhtml gulp-jshint gulp-strip-debug gulp-zip --save-dev
var gulp = require('gulp'),
clean = require('gulp-clean'),
cleanhtml = require('gulp-cleanhtml'),
minifycss = require('gulp-minify-css'),
jshint = require('gulp-jshint'),
stripdebug = require('gulp-strip-debug'),
@lykmapipo
lykmapipo / Hide Splashscreen in Ionic App
Created January 23, 2016 12:12 — forked from sean-hill/Hide Splashscreen in Ionic App
Hide Splashscreen in Ionic App with ngCordova
Hide Splashscreen in Ionic App
@lykmapipo
lykmapipo / Ubuntu_Setup_for_Production_NodeJS_Deployment.md
Last active May 20, 2020 07:23
Ubuntu Setup for Production NodeJS Deployment
#!/bin/bash

# update ubuntu server
sudo apt-get update

# upgrade ubuntu server
sudo apt-get upgrade

# install curl, make, g++ and git
#!/bin/bash
if [ "$GIT_SSH_KEY" != "" ]; then
echo "Cleaning up SSH config" >&1
echo "" >&1
# Now that npm has finished running,
# we shouldn't need the ssh key/config anymore.
# Remove the files that we created.
rm -f ~/.ssh/config
rm -f ~/.ssh/deploy_key
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
mongoose.connect('localhost', 'testing_querybydate');
var schema = new Schema({
created: Date
, data: {}
});
var A = mongoose.model('A', schema);
@lykmapipo
lykmapipo / socketio_module.md
Last active April 17, 2016 14:05
Collection of socket.io modules