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
(defn fizzbuzz | |
[] | |
(doseq [i (range 0 100)] | |
(cond | |
(and (= 0 (mod i 3)) (= 0 (mod i 5))) (prn "FizzBuzz") | |
(= 0 (mod i 3)) (prn "Fizz") | |
(= 0 (mod i 5)) (prn "Buzz") | |
:else (prn i)))) |
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
defmodule Math.GCD do | |
@moduledoc "Functions for finding the Greatest Common Denominator" | |
@doc "Given two numbers, find their GCD" | |
def gcd(a, b) do | |
gcd b, rem a, b | |
end | |
@doc "Given a list of numbers, find their GCD." | |
def gcd(l) do |
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 FizzBuzz { | |
def main(args: Array[String]) { | |
1.to(100).foreach( (i:Int) => (i % 3, i % 5) match { | |
case (0,0) => println("FizzBuzz") | |
case (0, _) => println("Fizz") | |
case (_, 0) => println("Buzz") | |
case _ => println(i) | |
} | |
) | |
} |
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
(use 'korma.core 'korma.db) | |
(defdb mydb {:classname "org.hd.Driver" :protocol "file" :subprotocol "h2" :subname "./tmp/mydb"}) |
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
doubleMe x = x + 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
fizzBuzz :: (Integral a, Show a) => a -> String | |
fizzBuzz n | |
| n `mod` 3 == 0 && n `mod` 5 == 0 = "FizzBuzz" | |
| n `mod` 3 == 0 = "Fizz" | |
| n `mod` 5 == 0 = "Buzz" | |
| otherwise = show n | |
-- [fizzBuzz x | x <- [1..100]] |
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
Joshs-MacBook-Air:~ josh$ curl https://api.tldr.io/tldrs/s":["http://www.taigeair.com/why-gmail-2013-sucks-terribad-user-experience.html"]}' -v | |
* About to connect() to api.tldr.io port 443 (#0) | |
* Trying 178.79.181.8... | |
* connected | |
* Connected to api.tldr.io (178.79.181.8) port 443 (#0) | |
* SSLv3, TLS handshake, Client hello (1): | |
* SSLv3, TLS handshake, Server hello (2): | |
* SSLv3, TLS handshake, CERT (11): | |
* SSLv3, TLS handshake, Server key exchange (12): | |
* SSLv3, TLS handshake, Server finished (14): |
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
.hsenv/ | |
hsenv.log | |
*.hi | |
*.o |
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.Aeson |
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
(defproject builder-post "0.1.0") |