Skip to content

Instantly share code, notes, and snippets.

View ContainersVsComponentsExamples.jsx
// containers vs components, a component cannot use anything not passed in via props,
// and can only communicate via callbacks passed via props
// Approach: one provider per data
<GameDataProvider gameId={this.props.gameId}>
{gameData =>
<GameProvider gameId={this.props.gameId}>
{game =>
<ServerListContainer query={this.props.query}>
{servers =>
@tjogin
tjogin / README.md
Created Sep 5, 2011 — forked from rodrigorm/README.md
Configuration file to use PHP with Ruby rack
View README.md

Installation

First you need php-cgi, i used brew with Formula below:

$ curl -O https://raw.github.com/gist/1194269/7ae1709453a8a19ce9c030bf41d544dd08d96d85/php.rb
$ mv php.rb `brew --prefix`/Library/Formula
$ brew install php --with-mysql

Second, install this ruby gems:

@tjogin
tjogin / rackup.ru
Created Jun 9, 2011
Simple rack server
View rackup.ru
class Server
@@mime_types = { :txt => 'text/plain', :js => 'application/x-javascript', :css => 'text/css' }
def call(env)
file = file_name env["REQUEST_PATH"]
if File.exists? file
[200, { 'Content-Type' => mime_type_for_file(file) }, [ File.read(file) ] ]
else
[404, { 'Content-Type' => 'text/html' }, []]
end
@tjogin
tjogin / .git-completion.sh
Created Jun 8, 2011
Bash git completion
View .git-completion.sh
#!bash
#
# bash completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
View .bash_profile
source ~/.bashrc
source ~/.git-completion.sh
source ~/.colors.sh
GIT_PS1_SHOWDIRTYSTATE=1
if [ "\$(type -t __git_ps1)" ]; then
#PS1="\h:\w \$(__git_ps1 '(%s)')$"
GIT_BRANCH="${BRIGHT_CYAN}\$(__git_ps1 '(${CYAN}%s${BRIGHT_CYAN})')${NORMAL}"
PS1="${WHITE}\h:\w $GIT_BRANCH \$ ${RESET}"
View colors.sh
DULL=0
BRIGHT=1
FG_BLACK=30
FG_RED=31
FG_GREEN=32
FG_YELLOW=33
FG_BLUE=34
FG_VIOLET=35
FG_CYAN=36