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
# Julia is fully unicode aware and if you use your variable and function | |
# names just right, you can express your anger like no other language. | |
⋰┛ಠДಠ┛⋱彡┻━┻(n) = n < 2 ? n : ⋰┛ಠДಠ┛⋱彡┻━┻(n - 1) + ⋰┛ಠДಠ┛⋱彡┻━┻(n - 2) | |
@elapsed ⋰┛ಠДಠ┛⋱彡┻━┻(25) # 0.00266 |
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
# Taken from @chancancode https://speakerdeck.com/chancancode/turbo-rails-in-rust | |
>> require "canada" | |
=> true | |
>> " ".blank_eh? | |
=> true | |
>> "hi".blank_eh? | |
=> false |
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
(: taken from http://markmail.org/message/5p3uespuxk4ew7fa :) | |
let $regexp := '(\{)|(\})|(\[)|(\])|(:)|(,)|(true)|(false)|(null)|(\s+)|("([^"\\]|\\"|\\\\|\\/|\\b|\\f|\\n|\\r|\\t|\\u[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9])*")|(-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)?)' | |
return | |
let $json := '{ | |
"firstName": "John", | |
"lastName": "Smith", | |
"address": { | |
"streetAddress": "21 2nd Street", |
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
-- Taken from https://www.youtube.com/watch?v=6KkF5-_erns#t=1154 | |
-- Original code taken from https://github.com/haskelllive/haskelllive/blob/episode-1/Chess.hs | |
module Chess where | |
-- This call reads in a string grid of a chessboard with each row separated by a newline | |
-- and returns an encoded board where each position could be Nothing or an encoded piece | |
-- type (returned from readSquare). | |
-- | |
readBoard :: String -> Maybe Board |