This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// <label for={this.props.label}>{this.props.label}</label> | |
// compiles to... | |
React.DOM.label( {for:this.props.label}, this.props.label) | |
// should be... | |
React.DOM.label( {"for":this.props.label}, this.props.label) | |
// Because IE doesn't allow language keywords to appear unquoted in object literal keys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Data.Maybe | |
import Data.Monoid | |
import Control.Applicative | |
-- Mostly stolen from an answer found posted on reddit. | |
-- This formulation achieves a high level of modularity and clarity. | |
-- It is modular with respect to adding more numbers to fizz and buzz against, | |
-- and captures the idea of `show`ing the number by default elegantly. | |
t m s n = if mod n m == 0 then Just s else Nothing | |
-- instance Applicative ((->) a) where (<*>) f g x = f x (g x) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#install zeromq | |
wget http://download.zeromq.org/zeromq-4.0.5.tar.gz | |
tar -xzf zeromq-4.0.5.tar.gz | |
cd zeromq-4.0.5 | |
./configure | |
make | |
sudo make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fizz(n): | |
for i in xrange(1, n+1): | |
print i, fz(i) | |
def t(m, s, n): | |
return s if (n%m==0) else '' | |
def fz(n): | |
s = ''.join([ | |
t(3, 'Fizz', n), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
createdb dbname | |
pg_restore -d dbname -Ocxv db.dump | |
# -c Clean, -O no owner, -v verbose, -x no privileges no acl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EXPLAIN select * from tablename where uuid LIKE 'as%'; | |
QUERY PLAN | |
----------------------------------------------------------------------------------------------------------------------- | |
Index Scan using tablename_uuid_like on tablename (cost=0.14..8.16 rows=1 width=1476) | |
Index Cond: (((uuid)::text ~>=~ 'as'::text) AND ((uuid)::text ~<~ 'at'::text)) | |
Filter: ((uuid)::text ~~ 'as%'::text) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
import Control.Concurrent | |
import Web.Growler | |
import Web.Growler.EventSource | |
import Network.Wai.EventSource | |
main = growl id defaultConfig $ get "/" $ eventSource es |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- :set -XOverloadedStrings | |
import Web.Growler | |
import Network.Wai.Handler.Warp as Warp | |
Warp.run 3001 =<< growler id defaultConfig (get "/" $ text "Hello") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Dict exposing (Dict) | |
import Html exposing (..) | |
import Html.Attributes exposing (..) | |
import Html.Events exposing (..) | |
import String | |
import Debug exposing (log) | |
import Json.Decode as Json | |
import Signal exposing (Address) | |
import StartApp.Simple | |
import Json.Decode as Json |
OlderNewer