made with esnextbin
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
optional "note" string "" | |
optional "note" (map Just string) Nothing | |
optional "note" (map (\x -> if x == "" then Nothing else Just x) string) Nothing | |
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
bang : String -> String | |
bang str = | |
str ++ “!” | |
uppercase : String -> String | |
uppercase str = | |
String.toUpper str |
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 Html exposing (div, button, text, p) | |
import Html.App exposing (beginnerProgram) | |
import Html.Events exposing (onClick, on, targetValue) | |
import Html.Attributes exposing (style) | |
import Json.Decode as Json | |
main = | |
beginnerProgram { model = init, view = view, update = update } | |
-- Model |
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 Html exposing (..) | |
import Html.App as Html | |
import Html.Attributes exposing (..) | |
import Html.Events exposing (..) | |
import Http | |
import Json.Decode as Json | |
import String exposing (..) | |
import Task | |
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 StartApp.Simple exposing (start) | |
import Html exposing (Html, div, text) | |
import Html.Attributes exposing (contenteditable) | |
import Html.Events exposing (on, targetValue) | |
-- Model | |
type alias Model = String | |
init : Model |
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
process.on('SIGINT', function () { | |
console.log('killed'); | |
}); | |
process.stdin.emit('SIGINT'); | |
console.log('continued'); |
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
const partial = (fn, oldArgs = []) => (...newArgs) => { | |
const totalNumberOfArgsRequired = fn.length; | |
const args = oldArgs.concat(newArgs); | |
const numberOfRemainingArgs = totalNumberOfArgsRequired - args.length; | |
return (numberOfRemainingArgs > 0) ? | |
partial(fn, args) : | |
fn(...args); | |
} | |
export default partial; |
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
###### | |
# This Makefile was written to compile my attempts while studying Learn C the Hard Way | |
# it will look inside the src directory and compile all files ending in .c to the bin directory, | |
# one executable for every source file (no linking, no object files etc.) | |
###### | |
## Debug CFLAGS: | |
CFLAGS=-Wall -g -pipe | |
## Non-debug CFLAGS: | |
#CFLAGS=-pipe -O2 |