Skip to content

Instantly share code, notes, and snippets.

View kamiyam's full-sized avatar
🏠
Working from home

kamiyam kamiyam

🏠
Working from home
View GitHub Profile
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
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"
@kenjiskywalker
kenjiskywalker / aws-ec2-vpc.md
Last active October 31, 2018 11:14
EC2をVPCにアサインして、EIP用のNetwork Interfaceを追加して外部と接続できるようにする

EC2をVPCにアサインして外部から接続する

VPCにアサインされたEC2インスタンスへ
Network Interfaceを追加し、外部からVPC内のインスタンスへ接続できるようにする。

画像がないのでわかりづらいけど自分用メモということで。

Q&A

@konitter
konitter / grunt-memo.md
Last active December 13, 2015 21:08
grunt@0.4系(開発版)自分用メモ
@Mantish
Mantish / AuthController.js
Last active December 21, 2015 21:09 — forked from theangryangel/AuthController.js
Sails.js (v0.9.3) authentication using Passportmiddleware
// api/controllers/AuthController.js
var passport = require('passport');
var AuthController = {
login: function (req,res)
{
res.view();
},
@dougalcampbell
dougalcampbell / ds-duino.ino
Created September 10, 2013 17:37
Digispark and nodejs - talking to the Digispark Arduino-compatible microcontroller via USB with the node-hid library
/*
* 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?
@mikermcneil
mikermcneil / using-raw-socket-io-in-sails.js
Created September 17, 2013 18:32
Using raw socket.io functionality in a Sails.js controller
module.exports = {
/**
*
* Using raw socket.io functionality from a Sails.js controller
*
*/
index: function (req,res) {
@kitak
kitak / build.md
Last active December 23, 2015 07:39
Apacheのソースコードビルドまとめ

iptables off

sudo /etc/init.d/iptables stop

事前にインストールが必要なもの

sudo yum groupinstall "Development Tools"
sudo yum install pcre-devel
<!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" />
@yuka2py
yuka2py / modernizer.environ.js
Last active December 29, 2015 18:59
デバイスやブラウザを判定する Modernizr 用の追加テストです。 えっと…。いや、実務では要りますよ。やっぱり。今回まとめました。
(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');