Skip to content

Instantly share code, notes, and snippets.

@ni-ko-o-kin
ni-ko-o-kin / elm
Created March 14, 2024 13:40
[bug] elm-concurrent-task: debug
port module Main exposing (main)
import ConcurrentTask exposing (ConcurrentTask)
import ConcurrentTask.Http as Http
import Json.Decode as Decode
type alias Model =
{ tasks : ConcurrentTask.Pool Msg Error Titles
}
@ni-ko-o-kin
ni-ko-o-kin / Mein.elm
Created March 11, 2020 11:52
Phantom Builder Pattern with Elm
module Main exposing (main, view)
import Browser
import Html exposing (Html, button, div, text)
import Html.Attributes exposing (style)
main =
Browser.sandbox
{ init = ()
@ni-ko-o-kin
ni-ko-o-kin / config.el
Created February 26, 2020 08:00
doom-config
;;; package -- summary
;;; .doom.d/config.el -*- lexical-binding: t; -*-
;;; commentary:
;;; code:
;;; basics
(setq doom-font (font-spec :family "Source Code Pro" :size 16))
(setq treemacs-show-hidden-files nil)
(setq-default frame-title-format '((:eval default-directory)))
@ni-ko-o-kin
ni-ko-o-kin / Main.elm
Last active December 23, 2019 22:28
elm-node
port module Main exposing (main)
import Json.Decode as D exposing (Decoder, Value)
import Json.Encode as E
import Platform exposing (worker)
type Msg
= Run Value
@ni-ko-o-kin
ni-ko-o-kin / Main.elm
Last active December 8, 2019 09:31
elm-find-by-type-and-value
module Main exposing (main)
import Browser
import Html exposing (Html, div, text)
type alias Model =
{}
{
"codeLens.enable": true,
"coc.preferences.formatOnSaveFiletypes": ["elm", "javascript"],
"coc.preferences.hoverTarget": "float",
"languageserver": {
"elmLS": {
"command": "elm-language-server",
"filetypes": ["elm"],
"rootPatterns": ["elm.json"],
"initializationOptions": {
call plug#begin('~/.vim/plugged')
"common
Plug 'tpope/vim-surround'
Plug 'itchyny/lightline.vim'
Plug 'neoclide/coc.nvim', { 'branch': 'release' }
Plug 'lifepillar/vim-solarized8'
Plug 'scrooloose/nerdtree'
Plug 'scrooloose/nerdcommenter'
(function(scope){
'use strict';
function F(arity, fun, wrapper) {
wrapper.a = arity;
wrapper.f = fun;
return wrapper;
}
function F2(fun) {
@ni-ko-o-kin
ni-ko-o-kin / main.js
Last active September 18, 2019 23:42
use elm with meteor without a meteor package
// startup/client/main.js
import { Meteor } from 'meteor/meteor';
import '/elm-client/elm-main';
Meteor.startup(() => {
const app = Elm.Main.init({
node: document.getElementById('elm-root'),
flags: {},
});
@ni-ko-o-kin
ni-ko-o-kin / package.js
Last active September 18, 2019 08:00
elm compiler for meteor
Package.describe({
summary: 'compile elm to js',
version: '1.0.0',
name: 'niko:elm',
});
Package.registerBuildPlugin({
name: 'elm',
sources: ['plugin.js'],
use: ['caching-compiler@1.2.0'],