Skip to content

Instantly share code, notes, and snippets.

View boombang's full-sized avatar

Artem Kazaryan boombang

View GitHub Profile
package com.example.chess;
import java.util.Hashtable;
import java.util.Random;
import javafx.application.Application;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import javafx.scene.layout.GridPane;
-- Piping: Chaining functions
foo =
Html.text (String.fromInt (add 5 (multiply 10 (divide 30 10))))
-- x |> f = f x
baz =
divide 30 10
|> multiply 10
|> add 5
import Json.Decode exposing (Decoder, field, string)
gifDecoder : Decoder String
gifDecoder =
field "data" (field "image_url" string)
type PullRequestState
= Proposed
| Rejected
| Merged
branchColor : PullRequestState -> String
branchColor state =
case state of
Proposed ->
"yellow"
add : Int -> Int -> Int
add a b =
a + b
addOne : Int -> (Int -> Int)
addOne a =
add 1
two =
addOne 1
type Maybe a
= Just a
| Nothing
-- Partial Functions
-- toFloat : String -> Maybe Float
a =
String.toFloat "123"
list =
[ 1, 2, 3, 4 ]
push =
list ++ [ 5 ]
unshift =
0 :: list
lampard =
{ name = "Frank"
, lastname = "Lampard"
, age = 41
}
type alias Player =
{ name : String
, lastname : String
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="/favicon.ico">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>initial hmtl example</title>
<link href="/static/css/main.487d312c.css" rel="stylesheet">
</head>
const { resolve, join } = require('path')
const CompressionPlugin = require('compression-webpack-plugin')
module.exports = {
entry: './app.js',
output: {
path: resolve(join(__dirname, 'build')),
filename: 'app.js'
},
module: {