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
exports.Person = function(firstName,lastName) { | |
this.firstName = firstName; | |
this.lastName = lastName; | |
}; |
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
# Upgrade to OS X Lion, notice your virtualenvs are all hosed. | |
# Install Xcode 4.1 from the app store (or //fs2/IT/Apple/). | |
# Make sure to actually *run* the install, it's an app inside Applications. Throw it away afterwards, if you want the space back. | |
sudo easy_install pip | |
sudo pip install virtualenv virtualenvwrapper ipython | |
# blow the old one(s) away | |
rmvirtualenv playdoh |
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
!------------------------------------------------------------------------------- | |
! Xft settings | |
!------------------------------------------------------------------------------- | |
Xft.dpi: 96 | |
Xft.antialias: false | |
Xft.rgba: rgb | |
Xft.hinting: true | |
Xft.hintstyle: hintslight |
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
object RWS extends App { | |
trait Pointed[P[_]] { | |
def point[A](a: A): P[A] | |
} | |
trait PointedFunctor[PF[_]] extends Pointed[PF] with Functor[PF] | |
implicit def listIsMonoid[A]: Monoid[List[A]] = new Monoid[List[A]] { | |
def id: List[A] = Nil |
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
class ActionDispatch::Routing::Mapper | |
def draw(routes_name) | |
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb"))) | |
end | |
end | |
BCX::Application.routes.draw do | |
draw :api | |
draw :account | |
draw :session |
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
group :production do | |
gem "unicorn" | |
end |
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
# --- !Ups | |
CREATE TABLE users( | |
email VARCHAR(255) NOT NULL PRIMARY KEY, | |
name VARCHAR(255) | |
); | |
CREATE TABLE subjects( | |
id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, | |
title LONGTEXT NOT NULL, |
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 scalaz._ | |
import Scalaz._ | |
import scalaz.iteratee._ | |
import EnumeratorT._ | |
def counter[A, F[+_]: Pointed] = | |
IterateeT.fold[A, F, Int](0) { (acc: Int, a: A) => acc + 1 } | |
def count[A, F[+_]: Monad](e: EnumeratorT[A, F]) = | |
(counter[A, F] &= e).run |
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
sealed trait KeyValueStore[+A] { | |
def map[B](f: A => B): KeyValueStore[B] = | |
this match { | |
case Put(k, v, q) => Put(k, v, f compose q) | |
case Get(k, q) => Get(k, f compose q) | |
case Del(k, q) => Del(k, f compose q) | |
} | |
} | |
case class Put[A](k: String, v: String, q: Option[String] => A) extends KeyValueStore[A] | |
case class Get[A](k: String, q: Option[String] => A) extends KeyValueStore[A] |
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
source "http://rubygems.org" | |
gem "guard-shell" | |
gem "rake" |
OlderNewer