Skip to content

Instantly share code, notes, and snippets.

@rofrol
rofrol / Main.elm
Created April 11, 2018 13:21
Full example from http://folkertdev.nl/blog/elm-messy-json-value/ updated to elm 0.18
module Main exposing (..)
import Html exposing (text)
import Json.Decode as Decode exposing (..)
type FormField
= InputField Input
| DecimalField Decimal
| SpecialField String
@rofrol
rofrol / flatten.js
Last active March 27, 2018 11:52
flatten.js
/*
Write some code, that will flatten an array of arbitrarily nested arrays of integers into a flat array of integers. e.g. [[1,2,[3]],4] -> [1,2,3,4].
Your solution should be a link to a gist on gist.github.com with your implementation.
When writing this code, you can use any language you're comfortable with. The code must be well tested and documented if necessary, and in general please treat the quality of the code as if it was ready to ship to production.
Try to avoid using language defined methods like Ruby's Array#flatten.*
@rofrol
rofrol / jsx-cheatsheet.md
Last active December 13, 2020 08:51
jsx cheatsheet

Mój krótki poradnik o JSX

Wstęp

To nie jest style guide, więc można za pewne ładniej to napisać. Poradnik ma zwięźle pokazać działanie JSX.

JSX

JSX to jakby HTML. Składnia XML, ale zmieszany z javascriptem:

@rofrol
rofrol / .psqlrc
Created August 17, 2017 09:52 — forked from tkalfigo/.psqlrc
My .psqlrc
\set QUIET 1
\pset null '(null)'
\pset linestyle unicode
\pset border 2
\timing
\set ON_ERROR_ROLLBACK interactive
\set HISTFILE ~/.psql_history- :HOST - :DBNAME
\set HISTSIZE 2000
\set PROMPT1 '%n@%/[%M:%>] # '
\set PROMPT2 '> '
@rofrol
rofrol / .psqlrc
Created August 17, 2017 09:52 — forked from tkalfigo/.psqlrc
My .psqlrc
\set QUIET 1
\pset null '(null)'
\pset linestyle unicode
\pset border 2
\timing
\set ON_ERROR_ROLLBACK interactive
\set HISTFILE ~/.psql_history- :HOST - :DBNAME
\set HISTSIZE 2000
\set PROMPT1 '%n@%/[%M:%>] # '
\set PROMPT2 '> '
@rofrol
rofrol / .gitignore
Last active January 17, 2022 16:20
Rust + Rocket + rust-postgres
target

linter-elm-make

Always Compile Main: Yes

You can have the main paths set per project with file linter-elm-make.json and content like:

{
  "mainPaths": [
    "src/elm/Main.elm"

]

@rofrol
rofrol / Cargo.toml
Last active August 19, 2016 11:47 — forked from gkbrk/Cargo.toml
Asynchronous server example in Rust
[package]
name = "rust-async-qotd"
version = "0.1.0"
authors = ["Gökberk Yaltıraklı <[email protected]>"]
[dependencies]
tokio = { git = "https://github.com/tokio-rs/tokio" }
rand = "0.3"
[[bin]]
@rofrol
rofrol / Cycle.js timer demo.markdown
Last active January 31, 2016 21:14
Cycle.js timer demo