| 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); |
| -- 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 |
| -- 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 |
| 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 |
#!/bin/bash
# update ubuntu server
sudo apt-get update
# upgrade ubuntu server
sudo apt-get upgrade
# install curl, make, g++ and git| Hide Splashscreen in Ionic App |
| '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'), |
##Chrome Packaged Apps
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.
Chrome packaged apps are applic