Skip to content

Instantly share code, notes, and snippets.

View lykmapipo's full-sized avatar

lally elias lykmapipo

View GitHub Profile
@lykmapipo
lykmapipo / GridStream.js
Created June 18, 2016 09:57 — forked from psi-4ward/GridStream.js
NodeJS MongoDB-GridFS Video range stream example Lets your browser seek/jump wihin the video-playback.
var app = require('express')();
var GridStore = require('mongodb').GridStore;
var ObjectID = require('mongodb').ObjectID;
var MongoClient = require('mongodb').MongoClient;
var Server = require('mongodb').Server;
var dbConnection;
MongoClient.connect("mongodb://localhost:27017/ersatz?auto_reconnect", {journal: true}, function(err, db) {
dbConnection = db;
app.listen(3000);
@lykmapipo
lykmapipo / gist:6a8f56aec23fda81796530ae87b13ec8
Created April 27, 2016 11:59 — forked from klovadis/gist:5170485
A Lua script for Redis that allows you to set hash values based on a dictionary table
-- sets all fields for a hash from a dictionary
local hmset = function (key, dict)
if next(dict) == nil then return nil end
local bulk = {}
for k, v in pairs(dict) do
table.insert(bulk, k)
table.insert(bulk, v)
end
return redis.call('HMSET', key, unpack(bulk))
end
@lykmapipo
lykmapipo / gist:26204afbfe17f2f3f418316e4ccc227c
Created April 27, 2016 11:59 — forked from klovadis/gist:5170446
Two Lua scripts for Redis to turn HGETALL and HMGET into dictionary tables
-- gets all fields from a hash as a dictionary
local hgetall = function (key)
local bulk = redis.call('HGETALL', key)
local result = {}
local nextkey
for i, v in ipairs(bulk) do
if i % 2 == 1 then
nextkey = v
else
result[nextkey] = v
@lykmapipo
lykmapipo / socketio_module.md
Last active April 17, 2016 14:05
Collection of socket.io modules
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);
#!/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
@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
@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 / 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 / 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