Skip to content

Instantly share code, notes, and snippets.

View rootscript's full-sized avatar

Carlos rootscript

  • UK
View GitHub Profile
@rootscript
rootscript / Json2li.elm
Last active October 18, 2016 00:50 — forked from freakingawesome/so-35028430.elm
How to extract the results of Http Requests in Elm
import Html exposing (..)
import Html.App exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import Html.Attributes exposing (..)
import Http
import Task exposing (Task)
import Json.Decode as Json exposing ((:=))
type Msg
@rootscript
rootscript / elm-destructuring.md
Last active December 15, 2021 20:44 — forked from yang-wei/destructuring.md
Elm Destructuring (or Pattern Matching) cheatsheet

Destructuring(or pattern matching) is a way used to extract data from a data structure(tuple, list, record) that mirros the construction. Compare to other languages, Elm support much less destructuring but let's see what it got !

Tuple

myTuple = ("A", "B", "C")
myNestedTuple = ("A", "B", "C", ("X", "Y", "Z"))

let
  (a,b,c) = myTuple
@rootscript
rootscript / private.xml
Last active May 26, 2020 18:22 — forked from mlan3/private.xml
Karabiner private.xml for non-Apple keyboard to toggle Target Display Mode
<?xml version="1.0"?>
<root>
<devicevendordef>
<vendorname>LOGITECH</vendorname>
<vendorid>0x046d</vendorid>
</devicevendordef>
<deviceproductdef>
<productname>LOGITECH_K811</productname>
<productid>0xb317</productid>
@rootscript
rootscript / 0_reuse_code.js
Last active August 29, 2015 14:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console