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
(ns hello-world.core | |
(:require [clojure.string :as str])) | |
(def substitute (sorted-map 3 "Fizz" 5 "Buzz")) | |
(defn play [n] | |
(let [match (filter #(= 0 (mod n %)) (keys substitute))] | |
(if (empty? match) | |
n | |
(str/join "" (map #(substitute %) match))))) |
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 pymongo | |
from pymongo import Connection | |
from pymongo.dbref import DBRef | |
from pymongo.database import Database | |
# connect | |
connection = Connection() | |
db = Database(connection, "things") | |
# clean up |
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 com.mongodb.* | |
// connect | |
mongo = new Mongo('localhost', 27017) | |
mongo.dropDatabase('things') | |
db = mongo.getDB('things') | |
owners = db.getCollection('owners') | |
tasks = db.getCollection('tasks') |
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
(ns dependency-mgmt.core | |
(:require [clojure.contrib.string :as str])) | |
(def classes "A B C | |
B C E") | |
(def deps (ref {})) | |
(defn build-dependency-map [seq] | |
(let [name (keyword (str (first seq))) |
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 static org.junit.Assert.*; | |
import java.util.HashMap; | |
import org.junit.Test; | |
public class FizzBuzzTest { | |
@Test | |
public void devuelveUno() throws Exception { | |
assertEquals("1", dime(1)); |
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 Board { | |
def fields = ["."] | |
def mark(token){ | |
if (fields[0] != ".") { | |
throw new RuntimeException("Already Taken!") | |
} | |
fields[0] = token | |
} | |
} |
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
Get the parts | |
* jasmine-node (https://github.com/mhevery/jasmine-node) | |
* watchr (https://github.com/mynyml/watchr) | |
* growlnotify (you can brew this) | |
* And of course coffeescript :) | |
You can see the demo here: http://holatdd.com/videos/kata-lonja (just advance the 5 first mins or so) | |
Create a project like this | |
├── spec |
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
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
.container { | |
} | |
.clip { | |
position: absolute; | |
//clip:rect(50px 218px 155px 82px); | |
} |
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
package com.learning; | |
import static org.junit.Assert.assertEquals; | |
import org.junit.Test; | |
public class RomanNumeralsTest { | |
interface RomanNumber { |
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
require 'formula' | |
class Dblatex < Formula | |
env :userpaths | |
url 'http://downloads.sourceforge.net/project/dblatex/dblatex/dblatex-0.3/dblatex-0.3.tar.bz2' | |
homepage 'http://dblatex.sourceforge.net' | |
md5 '7de6bf72b8b2934169ce0ec911e966ed' | |
def install | |
system "python", "setup.py", "install", "--prefix=#{prefix}", "--install-scripts=#{bin}" |
OlderNewer