VPCにアサインされたEC2インスタンスへ
Network Interfaceを追加し、外部からVPC内のインスタンスへ接続できるようにする。
画像がないのでわかりづらいけど自分用メモということで。
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
grunt@0.4系でStylusのコンパイル、Styledoccoの生成、CSSファイルの結合・minifyを自動化するためのメモ。
環境の構築はpackage.json
で行う。
gruntに関連したpackage.json
周りはこのページが詳しい。
Gruntによる継続的なビルド環境を求めて 〜 package.jsonと0.4.0のこと ::ハブろぐ
// api/controllers/AuthController.js | |
var passport = require('passport'); | |
var AuthController = { | |
login: function (req,res) | |
{ | |
res.view(); | |
}, |
/* | |
* Accept control commands via USB. | |
* | |
* Commands start with '!' and end with '.' | |
* Commands have three parts: action, pin, value: !AAPPVV. | |
* | |
* E.g. '!01p101.' is DigitalWrite, Pin1, value = 1 | |
* | |
* Note: This is currently *very* crude. Much improvement could be made. | |
* I think the use of strncpy is eating a lot of memory. Refactor? |
module.exports = { | |
/** | |
* | |
* Using raw socket.io functionality from a Sails.js controller | |
* | |
*/ | |
index: function (req,res) { |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<!-- Make the app behave more like a native app --> | |
<meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0, width=device-width, height=device-height" /> | |
<!-- Bootstrap styles --> | |
<link href="css/bootstrap.css" rel="stylesheet" media="screen" /> |
(function() { | |
if (!window.Modernizr) { | |
return; | |
} | |
var ua = new String(window.navigator.userAgent.toLowerCase()); | |
ua.has = function (cond) { | |
return this.indexOf(cond) != -1; | |
}; |
/** | |
* POST to create a new user. | |
*/ | |
exports.create = function *(){ | |
var body = yield parse(this); | |
// password | |
var pass = body.password; | |
assert(pass, 400, 'password is required'); |