Skip to content

Instantly share code, notes, and snippets.

View reedho's full-sized avatar

Muhammad Ridho reedho

View GitHub Profile
@reedho
reedho / deps.edn
Last active November 8, 2023 02:21
Datalevin range-seq with Missionary
{:paths ["src" "resources"]
:deps {org.clojure/clojure {:mvn/version "1.12.0-alpha5"}
missionary/missionary {:mvn/version "b.33"}
datalevin/datalevin {:mvn/version "0.8.21"}
}
:aliases
{:run-m {:main-opts ["-m" "playground.playground"]}
:run-x {:ns-default playground.playground
:exec-fn greet
@reedho
reedho / README.md
Created October 25, 2023 12:11
OpenHTmlToPdf Running Header & Footer

Note

  • Perhatikan posisi element .copyright menentukan apakah akan diulang untuk setiap page, atau misal setelah halaman tertentu saja, karena content nya aktif/tersedia pada saat dia sudah terbaca. Jika dia posisi nya di paling atas body content, maka ia akan diulang untuk setiap page, jika berada paling bawah, maka akan muncul di halaman terakhir saja.

  • Referensi lengkap nya di https://www.w3.org/TR/css-gcpm-3/#running-elements.

@reedho
reedho / clouflare-wrangler-readme.md
Created April 16, 2023 01:16
Cloudflare Wrangler

Cloudflare Wrangler

Tips setup wrangler project, berguna jika kita mau integrasi ke project yang sudah ada.

  • Install wrangler globally dengan npm install --location global wrangler.

  • Lalu create directory untuk project nya, misal: mkdir /tmp/x1 && cd /tmp/x1.

  • Init project dengan pnpm: pnpm init.

@reedho
reedho / README.md
Created April 14, 2023 03:47
Example request with contentful and sanity http api

Contentful.com

(require 'org.httpkit.client)
(do
  (def _base_url "https://cdn.contentful.com")
  (def _env "master")
  (def _space_id "xyz")
  (def _token "xyz")
  )
@reedho
reedho / FP-TS__looking_around.ts
Last active March 18, 2023 05:05
5 minute fp-ts fundamental overview
import assert from 'assert'
import * as Ma from 'fp-ts/Magma'
import * as Fu from 'fp-ts/Functor'
import * as Ap from 'fp-ts/Applicative'
import * as FN from 'fp-ts/function'
import * as B from 'fp-ts/boolean'
import * as S from 'fp-ts/string'
@reedho
reedho / all_suspect_chars.edn
Last active September 21, 2022 08:06
Check non latin characters in ojs publication abstract
#{\† \  \á \Â \â \™ \¤ \¥ \ˆ \€ \Î \‰ \° \± \² \– \³ \´ \µ \× \‘ \’ \º \“ \”}
@reedho
reedho / app.cljs
Last active September 29, 2021 09:12
@leonoel missionary in cljs
;; https://github.com/leonoel/missionary/tree/master/doc/tutorials
(ns my.web.app
(:require [missionary.core :as m]))
;; Basic how the `task` used in practice
(def slow-mo-hello-task
(m/sp (println "hello")
@reedho
reedho / app.cljs
Created September 28, 2021 10:13
Rumext ReactRouter v5
;; https://reactrouter.com/web/example/auth-workflow
;; ported to cljs with rumext
;; 28-Sep-2021
;; Ridho
(ns my.web.app
(:require ["react" :as react :refer [createContext useContext]]
["react-dom" :as react-dom]
[rumext.alpha :as mf]
[applied-science.js-interop :as j]
@reedho
reedho / init.el
Last active September 22, 2021 06:58
My spacemacs init.el
; -*- mode: emacs-lisp; lexical-binding: t -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Layer configuration:
This function should only modify configuration layer settings."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
;; `+distribution'. For now available distributions are `spacemacs-base'
@reedho
reedho / clojure_data_xml_usage.clj
Created June 10, 2019 07:51
Clojure data xml usage
(require '[clojure.data.xml :as xml])
;; `emit-str`
(xml/emit-str
(xml/sexp-as-element
[:Login
[:AgencyCode "agencycode"]
[:Username "XML_Agency"]
[:Password "Password@123"]]))