by Ossi Hanhinen, @ohanhi
with the support of Futurice 💚.
Licensed under CC BY 4.0.
module First where | |
import Html exposing (span, text) | |
main = span [ ] [text "Hello First!"] |
module Counter exposing (..) | |
import Html exposing (..) | |
import Html.Attributes exposing (style) | |
import Html.Events exposing (onClick) | |
-- MODEL | |
type alias Model = Int |
module Component exposing (..) | |
import Html exposing (..) | |
import Html.Attributes exposing (style) | |
import Html.Events exposing (onClick) | |
import Ports exposing (..) | |
-- MODEL |
/* | |
* Create an event emitter that goes like this | |
* emitter = new Emitter(); | |
* | |
* Allows you to subscribe to some event | |
* sub1 = emitter.subscribe('function_name', callback1); | |
* (you can have multiple callbacks to the same event) | |
* sub2 = emitter.subscribe('function_name', callback2); | |
* | |
* You can emit the event you want with this api |
import 'whatwg-fetch'; | |
import Config from 'config/Config'; | |
export const corsFetchOptions = { | |
// Enable cross-domain requests (CORS) | |
mode: 'cors', | |
// Send credentials cross-domain | |
credentials: 'include' | |
}; |
import fs from 'fs/promises'; | |
const rules = [ | |
{ | |
rule: /var ([^=]+)( = F\d\([^f]+function)[^(]\(/gmi, | |
replacement: `var $1$2 __$1( `, | |
}, | |
{ | |
rule: /(\sA\d\([\s]+)([^,]+)(,[\s]+)(function[^(]+)\(/gm, | |
replacement: `$1$2$3$4___$2(`, | |
}, |
These files illustrate the way that I have set up Nix and Home Manager for standalone use on macOS on both an Intel and Apple Silicon machine, in case the examples are useful to anyone. Some of the configuration is separated out into separate files in configs/
which get imported in home.nix
. Some of my existing dotfiles are placed in dotfiles/
and then symlinked in by Nix to the location that that the system expects to find them.
It is a work in progress so currently I am handling installation of R separately.