Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Make Cirru great again!

Jon jiyinyiyong

💭
Make Cirru great again!
View GitHub Profile
View program-ir.json
This file has been truncated, but you can view the full file.
{
"configs": {
"initFn": "app.main/main!",
"reloadFn": "app.main/reload!"
},
"files": {
"respo.core": {
"import": {
"element?": {
@jiyinyiyong
jiyinyiyong / compact.cirru
Created Jan 12, 2021
A example of `cr --emit-ir`
View compact.cirru
{} (:package |demo)
:configs $ {} (:init-fn |demo.main/main!) (:reload-fn |demo.main/reload!) (:version |0.0.1)
:files $ {}
|demo.main $ {}
:ns $ quote
ns demo.main $ :require ([] demo.core :as demo)
:defs $ {}
|main! $ quote
defn main! () (println "|Started.") (demo/show-something)
View phlox.core.js
import {initCrKeyword, initCrNil, initCrNumber, initCrBool, initCrString} from "./calcit.procs.mjs";
export * from "./calcit.procs.mjs";
import * as _calcit_ from "./calcit.core.mjs";
window["calcit_states:lilac.core"] = {};
import {preview_DASH_data} from "./lilac.util.mjs";
View app.main.cljs
(ns app.main )
(defn fibo [n] (if (< n 1) 0 (if (= n 1) 1 (+ (fibo (- n 1)) (fibo (- n 2))))))
(defn main! []
(js/console.log "Started.")
(let [start (js/Date.now), v (fibo 34), end (js/Date.now)]
(js/console.log v)
(js/console.log (- end start))))
@jiyinyiyong
jiyinyiyong / postal-codes.json
Created Oct 21, 2020
常用数据, 邮政编码信息
View postal-codes.json
[
{
"value": "110000",
"label": "北京市",
"children": [
{
"value": "110100",
"label": "市辖区",
"children": [
{
View chart.js
myChart.showLoading();
$.get(ROOT_PATH + '/data/asset/geo/HK.json', function (geoJson) {
myChart.hideLoading();
echarts.registerMap('HK', geoJson);
myChart.setOption(option = {
title: {
@jiyinyiyong
jiyinyiyong / deque.nim
Last active Oct 14, 2020
Compare deque add(at tail) and delete(at head) performance with seq and linkedlist
View deque.nim
import nimprof
import times
import lists
import deques
let n = 40000
proc loopDeque(): void =
var data: Deque[int]
@jiyinyiyong
jiyinyiyong / output.text
Created Oct 12, 2020
Time consumption of calcit-runner running a tiny script
View output.text
=>> cat tests/snapshots/add.cirru
{} (:package |app)
:configs $ {} (:init-fn |app.main/main!) (:reload-fn |app.main/reload!)
:files $ {}
|app.main $ {}
:ns $ quote
ns app.main $ :require
:defs $ {}
|main! $ quote
@jiyinyiyong
jiyinyiyong / mini_list.nim
Created Oct 10, 2020
Simpler list to try...
View mini_list.nim
type
MiniList*[T] = ref object
value*: T
next*: MiniList[T]
proc initMiniList*[T](xs: varargs[T]): MiniList[T] =
if xs.len == 0:
return nil