Skip to content

Instantly share code, notes, and snippets.

View rinn7e's full-sized avatar
💭
🐉

Moremi Vannak rinn7e

💭
🐉
View GitHub Profile
@rinn7e
rinn7e / index.js
Created June 16, 2023 05:53
Split khmer word
// Create a locale-specific word segmenter
let segmenter = new Intl.Segmenter("km", {granularity: "word"});
// Use it to get an iterator for a string
let input = "កូនខ្មែរអាចធ្វើបាន";
let segments = segmenter.segment(input);
console.log([...segments])

Haskeller Competency Matrix

See also List of materials about Software Design in Haskell

Junior Middle Senior Architect
Haskell level Basic Haskell Intermediate Haskell Advanced Haskell Language-agnostic
Haskell knowledge scope Learn you a Haskell Get programming with Haskell Haskell in Depth Knows several languages from different categories
Get programming with Haskell Haskell in Depth Functional Design and Architecture
[Other books on Software Engineering in Haskell](https://github.com/graninas/software-design-in-haskell#Books-on-So
@rinn7e
rinn7e / prettyprint.js
Created September 19, 2019 09:56
prettyprint js object
console.log(JSON.stringify(b, null, 4));

haskell record type is just syntactic sugar for rank n data type

data X = X { foo :: Int, bar :: Char }

is the same as

data X = X Int Char

Default bundling from purescript:
`purs bundle output/**/*.js -m Page.Home.Main -o spago-dist/index-home2.js`
After testing:
- parcel tree-shake is good but not good enough(500kb)
- default spago bundle or purs bundle (300kb) but buggy when specify main(need to figure out why)
- Need to find a better way (lower than 300kb)
@rinn7e
rinn7e / index.html
Created November 4, 2017 01:30
Elm Google Map
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Elm Google Map</title>
<style>
html, body{
margin:0;
padding:0;
}

Elm Resources

Tutorial and Introduction

module Calc exposing (..)
import Html exposing (..)
main =
div []
[ p [] [ text (toString (tf_idf 27 806791 18165)) ]
, p [] [ text (toString (tf_idf 4 806791 18165)) ]
, p [] [ text (toString (tf_idf 34 806791 18165)) ]
@rinn7e
rinn7e / todo.elm
Created January 29, 2017 08:14
Elm - Todo App: Give some example about nested record, how to update, delete and so on
module Main exposing (..)
import Html exposing (..)
import Html.Events exposing (..)
import Html.Attributes exposing (..)
main : Program Never Model Msg
main =
Html.beginnerProgram
@rinn7e
rinn7e / 0_reuse_code.js
Created December 2, 2016 06:56
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