This file contains hidden or 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 '/run/:location' do |location| | |
| geocoder = Geocoder.search(location) | |
| unless geocoder.empty? | |
| latitude = geocoder.first.data['geometry']['location']['lat'] | |
| longitude = geocoder.first.data['geometry']['location']['lng'] | |
| forecast = Forecast::IO.forecast(latitude, longitude) | |
| @location = geocoder.first.data['formatted_address'] | |
| tz = TZInfo::Timezone.get(forecast.timezone) | |
| next_hours = forecast.hourly.data.first(7).each_with_index.map do |data, index| | |
| { |
This file contains hidden or 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}" |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
NewerOlder