- 1 Overview of AngularJS (1hr)
- 1.1 AngularJS architecture overview
- 1.2 The Angular Batarang
- 1.3 Using Karma
- 1.4 Get Setup
- 1.5 Angular Seed Tour
- 1.6 Build: Hello World
- Bind tweet to input
This file contains 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
package main | |
import ( | |
"os" | |
"log" | |
"net" | |
"strconv" | |
"strings" | |
) |
This file contains 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
/** | |
* Find Records | |
* | |
* An API call to find and return model instances from the data adapter | |
* using the specified criteria. If an id was specified, just the instance | |
* with that unique id will be returned. | |
* | |
* @param {Integer|String} id - the unique id of the particular instance you'd like to look up | |
* @param {Object} where - the find criteria (passed directly to the ORM) | |
* @param {Integer} limit - the maximum number of records to send back (useful for pagination) |
This file contains 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
docker ps | awk {' print $1 '} | tail -n+2 > tmp.txt; for line in $(cat tmp.txt); do docker kill $line; done; rm tmp.txt |
This tutorial uses the "Sample hapi.js REST API" project.
Take a look at: https://github.com/agendor/sample-hapi-rest-api/
##Topics
- Introduction
- Installing Node.js
- Installing MySQL
- Setting-up the project
This file contains 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
func doPut(url string) { | |
client := &http.Client{} | |
request, err := http.NewRequest("PUT", url, strings.NewReader("<golang>really</golang>")) | |
request.SetBasicAuth("admin", "admin") | |
request.ContentLength = 23 | |
response, err := client.Do(request) | |
if err != nil { | |
log.Fatal(err) | |
} else { | |
defer response.Body.Close() |
Here's all you have to do to add clustering to your node.js application.
- save this code as
cluster.js
, and runcluster.js
instead ofserver.js
(or /bin/www, or whatever it's called for your project) - the only line you'll need to change is the last line - it needs to point to the location of your
server.js
file
var cluster = require('cluster');
if (cluster.isMaster) {
// Count the machine's CPUs
var cpuCount = require('os').cpus().length;
This file contains 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
// controllers/LoginController.js | |
module.exports = { | |
index: function(req, res) { | |
var email = req.param('email'); | |
var password = req.param('password'); | |
// delay everthing to prevent bruteforce, dos and timing attacks | |
setTimeout(function() { |
Mocha is a unittest framework for Node. In this document, we explain how you can test your javascript code and also your HTTP servers.
Use npm
to install Mocha:
npm install mocha
This file contains 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
package mongo | |
import ( | |
"time" | |
"log" | |
"gopkg.in/mgo.v2" | |
"gopkg.in/mgo.v2/bson" | |
) | |
// Profile - is the memory representation of one user profile |
OlderNewer