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
if (resp.isSuccess) | |
Future{ NoContent } | |
else passthrough(resp) | |
if (resp.isSuccess) { | |
Future{ NoContent } | |
} else { | |
passthrough(resp) | |
} |
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
enum Maybe<T> { | |
case Just(T) | |
case None | |
func maybe(def: T, fn: (T) -> (T)) -> T { | |
switch self { | |
case let Just(x): return fn(x) | |
case None: return def | |
} | |
} |
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
### Keybase proof | |
I hereby claim: | |
* I am rylev on github. | |
* I am ryanlevick (https://keybase.io/ryanlevick) on keybase. | |
* I have a public key whose fingerprint is F379 58BE 0E1A ECE1 D1DB A8E5 243E 54BE D142 3716 | |
To claim this, I am signing this object: |
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 Database.Redis | |
import Control.Monad.IO.Class | |
import Data.ByteString.Char8 | |
main :: IO () | |
main = do | |
conn <- connect defaultConnectInfo | |
runRedis conn $ do | |
set (pack "hello") (pack "hello") | |
hello <- get $ pack "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
defmodule RGB do | |
import Enum, only: [map: 2, join: 1, filter: 2, chunk: 2, count: 1] | |
def encode(rgb) when is_list rgb do | |
hex = rgb |> | |
map(&(integer_to_list &1, 16)) |> | |
map(fn [x] -> [x, x]; x -> x end) |> | |
map(&String.from_char_list!/1) |> | |
join | |
"#" <> hex |
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 TasksController | |
def index | |
Task.where(index_params) | |
end | |
def create | |
Task.create!(create_params) | |
end | |
private | |
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
module Main where | |
import System.Environment | |
import Text.ParserCombinators.Parsec | |
import Control.Monad | |
import Data.Char | |
main :: IO () | |
main = do putStrLn "What would you like to calculate:" | |
input <- getLine | |
putStrLn $ readExpr input |
NewerOlder