Using JSON in Postgres by example.
- Download and install: Docker Toolbox
- Open Docker Quickstart Terminal
- Start a new postgres container:
docker run --name my-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres
Using JSON in Postgres by example.
docker run --name my-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres| # | |
| # Ubuntu Node.js Dockerfile | |
| # | |
| # https://github.com/dockerfile/ubuntu/blob/master/Dockerfile | |
| # https://docs.docker.com/examples/nodejs_web_app/ | |
| # | |
| # Pull base image. | |
| FROM ubuntu:14.04 |
| # be sure to comment out the require 'capistrano/deploy' line in your Capfile! | |
| # config valid only for Capistrano 3.1 | |
| lock '3.2.1' | |
| set :application, 'my-cool-application' | |
| # the base docker repo reference | |
| set :name, "johns-stuff/#{fetch(:application)}" |
| openssl req -new -newkey rsa:2048 -nodes -keyout yourdomain.key -out yourdomain.csr | |
| http://support.godaddy.com/help/article/3601/generating-a-certificate-signing-request-nginx | |
| http://support.godaddy.com/help/article/4976/rekeying-an-ssl-certificate | |
| # Be sure to remember to chain them! | |
| cat gd_bundle-g2-g1.crt >> yourdomain.crt | |
| # Move 'em | |
| sudo mv yourdomain.crt /etc/ssl/certs/yourdomain.crt |
| // balanceador de carga | |
| var http = require('http'); | |
| // npm install http-proxy | |
| var http_proxy = require('http-proxy'); | |
| var proxServer = 0; | |
| var servidores = [ | |
| {'url':'http://localhost:8085'}, | |
| {'url':'http://localhost:8090'}, |
This is an example of how to scaffold API endpoints to list / get / create / update / delete Posts in a Keystone website.
It's a modification of the default project created with the yo keystone generator (see https://github.com/JedWatson/generator-keystone)
Gists don't let you specify full paths, so in the project structure the files would be:
routes-index.js --> /routes/index.js // modified to add the api endpoints
routes-api-posts.js --> /routes/api/posts.js // new file containing the Post API route controllers
| var ffmpeg = require('ffmpeg'); | |
| try { | |
| var process = new ffmpeg('example.mp4'); | |
| process.then(function (video) { | |
| console.log('The video is ready to be processed'); | |
| var watermarkPath = 'watermark-suissa.png', | |
| newFilepath = './video-com-watermark.mp4', | |
| settings = { | |
| position : "SE" // Position: NE NC NW SE SC SW C CE CW |
| <script> | |
| // in the html page | |
| angular.module('config', []).constant('APIKEY',''5250738f97ce29c219000011''); | |
| </script> | |
| myApp.controller('JobsCtrl', ['$scope', 'Jobs', 'APIKEY', function($scope, Jobs, apiKey) { | |
| var promise = Jobs(apiKey).query().$promise; | |
| // do more awesome programming | |
| } |
| //Primitive Type Comparison | |
| var a = 1; | |
| var b = 1; | |
| var c = a; | |
| console.log(a == b); //true | |
| console.log(a === b); //true | |
| console.log(a == c); //true | |
| console.log(a === c); //true |