Skip to content

Instantly share code, notes, and snippets.

@nanha
nanha / App.tsx
Created November 20, 2020 09:42 — forked from kotarella1110/App.tsx
Counter app example - TypeScript + React + Redux + redux-saga
import * as React from 'react';
import { Store, createStore, combineReducers, applyMiddleware } from 'redux';
import createSagaMiddleware from 'redux-saga';
import * as ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { reducer as counter, rootSaga } from './counter';
import Counter from './Counter';
const sagaMiddleware = createSagaMiddleware();
# you have ctags but it does not work...
$ ctags -R --exclude=.git --exclude=log *
ctags: illegal option -- R
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
#you need to get new ctags, i recommend homebrew but anything will work
$ brew install ctags
#alias ctags if you used homebrew
$ alias ctags="`brew --prefix`/bin/ctags"
#!/bin/sh
# Credentials for a MySQL user with PROCESS, SUPER permissions
USERNAME=
PASSWORD=
# MySQL Server location
HOST=127.0.0.1
PORT=3306
@nanha
nanha / dea.yml
Created May 19, 2013 03:52 — forked from conmame/dea.yml
---
deployment:
name: "dea"
domain: "hoge.com" #使用するドメイン
jobs:
install:
- stager
- dea:
local_route: "192.168.249.44" #自分の環境に合わせる (この設定ファイルが置かれるDEAのIPアドレス)
@nanha
nanha / gist:3129007
Created July 17, 2012 11:54 — forked from ishiduca/gist:2280639
node.js http.agent の agent.maxSockets の上限を避ける その2
var events,http, url, path;
events = require('events');
http = require('http');
url = require('url');
path = require('path');
var agents = {};
agent.onSocketsLengthChange;
if (http.getAgent) {
@nanha
nanha / clickify.js
Created July 8, 2012 12:29 — forked from maxweisel/clickify.js
collect.js - use clean urls with Backbone History / Router
(function($){
// Declare the rootUrl used for filtering internal links.
var rootUrl = document.location.protocol + '//' + (document.location.hostname || document.location.host) + (document.location.port ? ':' + document.location.port : '') + '/';
// Helper functions
var getFragment = function(url, root) { // Grab the fragment and format it how Backbone expects
var fragment = url;
if (fragment.indexOf(':') !== -1)
fragment = fragment.replace(/.*:\/\/[^\/]+/, '');
if (!fragment.indexOf(root)) fragment = fragment.substr(root.length);
@nanha
nanha / hello-node.js
Created July 7, 2012 02:06 — forked from nf/hello-node.js
Hello world web server that scales across multiple processors
var cluster = require('cluster');
var http = require('http');
var numCPUs = require('os').cpus().length;
if (cluster.isMaster) {
// Fork workers.
for (var i = 0; i < numCPUs; i++) {
cluster.fork();
}
cluster.on('exit', function(worker, code, signal) {
@nanha
nanha / hello-spdy3.js
Created July 4, 2012 02:59 — forked from shigeki/hello-spdy3.js
Hello SPDY by Node-0.7.x
var tls = require('tls');
var fs = require('fs');
var zlib = require('zlib');
var events = require('events');
var util = require('util');
var dictionary = require('./dict.js').dictionary;
var word = '<!DOCTYPE html><html><head><title>Hello SPDY</title></head><body>Hello SPDY</body></html>';
function parseNV_HeaderBlock(buffer) {
var nv = [];
@nanha
nanha / bespin.vim
Created July 4, 2012 02:22 — forked from acoffman/bespin.vim
vim colorscheme based on mozilla bespin
" Vim color file
" Converted from Textmate theme Bespin using Coloration v0.2.5 (http://github.com/sickill/coloration)
set background=dark
highlight clear
if exists("syntax_on")
syntax reset
endif
@nanha
nanha / nodejs.sh
Created June 13, 2012 11:59 — forked from crcastle/nodejs.sh
Node.js tartup script for AWS EC2 Linux box
#!/bin/bash
# nodejs - Startup script for node.js server
# chkconfig: 35 85 15
# description: node is an event-based web server.
# processname: node
# server: /path/to/your/node/file.js
# pidfile: /var/run/nodejs.pid
#