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
@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();
},
@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');
@jstcki
jstcki / README.md
Last active April 12, 2017 13:24
Transitions with React and D3 II

Using D3 in a React TransitionGroup to transition elements. D3 is used purely for transitions, not for data joins. The distinction between entering and exiting elements is handled by the TransitionGroup component. See the React documentation for further information.

Alternative implementations only with D3 and using React without addons.

Note: This implementation is around 30% slower in processing 1000 circles than the other two.

/*
* config/bootstrap.js
* Example of how to redirect all http request to https
* See http://jsbot.io/node/http-and-https-handle-with-sailsjs
*
*/
module.exports.bootstrap = function(cb) {
var express = require("express")
var app = express();
@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

@tkdn
tkdn / 2018-3-28.md
Created December 29, 2018 11:53
HOCs と TypeScript における型付けの肝

React HOCs on TypeScript

参考: https://medium.com/@jrwebdev/react-higher-order-component-patterns-in-typescript-42278f7590fb

まだ HOC と TypeScript の良い落としどころが見えてないが、何となく理解しつつある現状。 「TypeScript こわい」から卒業したのと、良記事があったので簡単にまとめておきます。

HOCs と TypeScript の相性

悪い。 => 型を設定することが難しい。 しかしやっていきたいので、any を使わずに整理していこう。