This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Save | |
$fh.data({ | |
"act": "save", | |
"key": "foo", | |
"val": "bar" | |
}, function () { | |
// save success | |
}, function (code) { | |
// save failed | |
} ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var nodeapp = require("fh-nodeapp"); | |
var _ = require('underscore'); | |
var util = require('util'); | |
var connect = require('fh-connect'); | |
nodeapp.HostApp.init(); | |
nodeapp.HostApp.serveApp(require('main.js'), function (err, server) { | |
// determine where the first route is defined on the middleware stack | |
var firstRouteIndex; | |
var firstRoute = _(server.stack).find(function (item, index) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$fh.init({}, function () { | |
// init ok | |
}, function (code, res) { | |
alert(res.error); | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var fh = require('fh-fhc'); | |
var async = require('async'); | |
// Init fhc | |
fh.fhc.load(function (err) { | |
if (err) return console.error(err); | |
// Target my domain and login | |
fh.target(['https://testing.feedhenry.me','[email protected]','password'], function(err, ok) { | |
if (err) return console.error(err); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# This script will mount /Users in the boot2docker VM using NFS (instead of the | |
# default vboxsf). It's probably not a good idea to run it while there are | |
# Docker containers running in boot2docker. | |
# | |
# Usage: sudo ./boot2docker-use-nfs.sh | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dtop() { | |
CONTAINER_IDS=$(docker ps | awk '{print $NF}' | grep -v NAMES) | |
printf "Running 'docker stats' for:\n$CONTAINER_IDS\n..." | |
docker stats $CONTAINER_IDS | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff nodejs-cloudappdefaz2zl_env_before.txt nodejs-cloudappdefaz2zl_env_after.txt | |
1a2 | |
> test1=test1 | |
3c4 | |
< [email protected] | |
--- | |
> [email protected] | |
30,31d30 | |
< FH_REDIS_PORT=6379 | |
< FH_REDIS_HOST=redis-1476286123337z2zl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ensure Docker >=v1.10.3 is installed | |
Ensure fhc is installed from this branch | |
npm i -g git://github.com/feedhenry/fh-fhc.git#workshop | |
Ensure 'oc' is installed | |
(Linux) curl -O http://192.168.1.247:8080/oc-linux.tar.gz | |
(Mac) curl -O http://192.168.1.247:8080/oc-mac.tar.gz | |
Clone these public repos into the same folder (preferably ~/work/) | |
feedhenry/fh-core-openshift-templates#master | |
feedhenry/fh-mbaas-openshift-templates#master | |
feedhenry/fh-cup#master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bytes = null; | |
// look for the Base64 encoded part of the line to decode | |
// both ssh-rsa and ssh-dss begin with "AAAA" due to the length bytes | |
for (String part : keyLine.split(" ")) { | |
if (part.startsWith("AAAA")) { | |
bytes = Base64.decodeBase64(part); | |
break; | |
} | |
} | |
if (bytes == null) throw new IllegalArgumentException("no Base64 part to decode"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: BuildConfig | |
metadata: | |
name: nodejsexample | |
namespace: nodejsexample | |
selfLink: /oapi/v1/namespaces/nodejsexample/buildconfigs/nodejsexample | |
uid: cce45238-b0b6-11e6-89c0-0abb8905d551 | |
resourceVersion: '23124054' | |
creationTimestamp: '2016-11-22T13:23:04Z' | |
labels: |
OlderNewer