Skip to content

Instantly share code, notes, and snippets.

@lxneng
lxneng / gist:741932
Created December 15, 2010 13:21
install PostgreSQL 9 in Mac OSX via Homebrew
install PostgreSQL 9 in Mac OSX via Homebrew
Mac OS X Snow Leopard
System Version: Mac OS X 10.6.5
Kernel Version: Darwin 10.5.0
Install notes for PostgreSQL 9.0.1 install using Homebrew:
sh-3.2# brew install postgresql
@taichi
taichi / LockFree.java
Created February 24, 2011 10:25
ConcurrentMap contains Set. feel easy but not.
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ConcurrentSkipListSet;
import java.util.concurrent.ExecutorService;
<script src=https://gist.github.com/raw/946328/gistfile1.txt ><\/script>
@erichurst
erichurst / database.yml.example mysql2
Created May 9, 2011 02:58
Rails 3 database.yml examples
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql2
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8
@terrancesnyder
terrancesnyder / setenv.sh
Created May 23, 2011 00:07
./setenv.sh - example setenv.sh with defaults set for minimal time spent in garbage collection
#! /bin/sh
# ==================================================================
# ______ __ _____
# /_ __/___ ____ ___ _________ _/ /_ /__ /
# / / / __ \/ __ `__ \/ ___/ __ `/ __/ / /
# / / / /_/ / / / / / / /__/ /_/ / /_ / /
#/_/ \____/_/ /_/ /_/\___/\__,_/\__/ /_/
# Multi-instance Apache Tomcat installation with a focus
# on best-practices as defined by Apache, SpringSource, and MuleSoft
@tily
tily / scaling_isomorphic_javascript_code.ja.markdown
Last active May 1, 2023 09:03
サバクラ両方で動く JavaScript の大規模開発を行うために

サバクラ両方で動く JavaScript の大規模開発を行うために

原文:Scaling Isomorphic Javascript Code (This is just for study, please contact me at tily05 atmark gmail.com if any problem.)

考えてみれば Model-View-Controller とか MVC ってよく聞くよね。実際どんなものか知ってる? 抽象的に言うなら「オブジェクト情報の保持されるグラフィック・システム (つまり、ラスターではないグラフィック。ゲームとか) 上に構築された、表示系を中心としたアプリケーションにおいて、主要な機能どうしの関わりをうまく分離すること」とでも言おうか。もう少し深く考えを押し進めてみれば、これは当然、他のさまざまなアプリケーションにもあてはまる言葉 (bucket term ?) だ。

過去に多くの開発コミュニティが MVC による解決案を提供し、それによってよくあるユースケースにうまく対処し、地位を築くことができた。例をあげるなら、Ruby や Python コミュニティは Rails や Django を作り、MVC アーキテクチャを実現した。

anonymous
anonymous / gist:1857262
Created February 18, 2012 03:46
closure example
def hoge() {
int data = 1
return {x -> if (x==1){data=10;return data}else{return data}}
}
clos = hoge()
assert clos.call(3) == 1
assert clos.call(1) == 10
assert clos.call(3) == 10
@kmizu
kmizu / gist:1876800
Last active December 22, 2019 00:05 — forked from gakuzzzz/gist:1865400
Scala環境構築

Scala 開発環境構築手順

前提条件

  • JDKがinstall済みであること
  • java コマンドに環境変数Pathが通っていること
@garnaat
garnaat / download.py
Created February 23, 2012 22:22
Use multiprocess to download objects from S3
"""
"""
import multiprocessing
import boto
import os
import sys
import datetime
import logging
import Queue
@kyanny
kyanny / Makefile
Created March 1, 2012 05:44
Makefile for fluentd convenient use
start:
fluentd -c ./fluent.conf -o /var/log/fluentd.log -d ./fluentd.pid -vv
stop:
pkill -f fluentd
restart:
pkill -f fluentd
sleep 1
fluentd -c ./fluent.conf -o /var/log/fluentd.log -d ./fluentd.pid -vv
check:
pgrep -f fluentd