Skip to content

Instantly share code, notes, and snippets.

Ossi Hanhinen ohanhi

Block or report user

Report or block ohanhi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Flags.elm
module Flags exposing (..)
import Browser
import Browser.Navigation
import Html exposing (p, text)
import Url
main : Program Int Int Msg
main =
@ohanhi
ohanhi / AutoExpand.elm
Created Mar 18, 2017
A pure Elm auto expanding text area
View AutoExpand.elm
module AutoExpand exposing (main)
-- https://embed.ellie-app.com/Gnv9Bznh4na1/0
import Html exposing (Html, div, p, br, textarea, text)
import Html.Attributes exposing (rows, style)
import Html.Events exposing (onInput, on)
import Json.Decode exposing (Decoder, field, at, map2, int, string)
type alias Model =
View ohanhi.zsh-theme
autoload -U colors && colors
autoload -Uz vcs_info
zstyle ':vcs_info:*' stagedstr '%F{green}•'
zstyle ':vcs_info:*' unstagedstr '%F{yellow}•'
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' enable git svn
theme_precmd () {
if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]] {
View why-and-when-to-elm.md

The Why and When of Choosing Elm

What is Elm?

  • Language (and "framework") for building web frontend applications
  • Can be used in place of HTML, CSS and JavaScript
  • Compiles into the above
@ohanhi
ohanhi / JsonApi.elm
Created Mar 26, 2016
Example abstraction layer on top of elm-http-extra
View JsonApi.elm
module JsonApi where
import Task exposing (Task)
import Json.Decode exposing (Decoder)
import Json.Encode exposing (Value)
import Http.Extra as HttpExtra exposing (..)
import Task exposing (Task)
import Json.Decode exposing (Decoder)
View console.log.js
var x = 1;
console.log(x);
if(1) {
var x = 2;
console.log(x);
}
console.log(x);
var x = 10;
function foo(x) {
@ohanhi
ohanhi / get-started-with-elm.md
Last active Jan 3, 2019
Get started with Elm
View get-started-with-elm.md
@ohanhi
ohanhi / joy-of-composition.md
Last active Jan 3, 2019
The Joy of Composition - Why stateless rendering is pure bliss
View joy-of-composition.md

This is a proposal for a lightning talk at the Reactive 2015 conference.

NOTE: If you like this, star ⭐️ the Gist - the amount of stars decides whether it makes the cut!

The Joy of Composition

Why stateless rendering is pure bliss

React just got stateless components, meaning that they are in essence pure functions for rendering. Pure functions make it dead simple - even fun - to refactor your views

@ohanhi
ohanhi / frp.md
Last active Aug 27, 2019
Learning FP the hard way: Experiences on the Elm language
View frp.md

Learning FP the hard way: Experiences on the Elm language

by Ossi Hanhinen, @ohanhi

with the support of Futurice 💚.

Licensed under CC BY 4.0.

Editorial note

View JSConf Budapest 2015 raw notes
# Day 1
## Andre
## What if the user was a function?
## Martin Kleppe @aemkei
## Invisible Code
- ASCII map, Mandelcode
- jswtf stuff
You can’t perform that action at this time.