Skip to content

Instantly share code, notes, and snippets.

View xiaoxiangmoe's full-sized avatar
🐰
busy

ZHAO Jin-Xiang xiaoxiangmoe

🐰
busy
View GitHub Profile
@Zheaoli
Zheaoli / Jetbrains JVM Config
Last active July 27, 2022 05:37
This is a JVM config for Jetbrains IDE on my laptop(With i9 10th CPU and 64G RAM)
-Xms128m
-Xmx8182m
-XX:ReservedCodeCacheSize=512m
-XX:CICompilerCount=2
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-XX:+UnlockExperimentalVMOptions -XX:+UseZGC
-XX:ZCollectionInterval=120 -XX:ZAllocationSpikeTolerance=5
-XX:+UnlockDiagnosticVMOptions -XX:-ZProactive
type ParseResult = {
success: boolean,
data: any,
source: string
}
type ParseFailed = {
suceess: false,
data: any,
source: string
@gcanti
gcanti / GADT.ts
Last active September 23, 2022 10:55
Approximating GADTs in TypeScript
// Adapted from http://code.slipthrough.net/2016/08/10/approximating-gadts-in-purescript/
import { Kind, URIS } from 'fp-ts/lib/HKT'
import { URI } from 'fp-ts/lib/Identity'
import { identity } from 'fp-ts/lib/function'
// ------------------------------------------
// Leibniz
// ------------------------------------------
@Lucifier129
Lucifier129 / codata.ts
Last active July 3, 2022 12:08
some codata examples in javascript/typescript
interface BtreeVisitor<T, TT> {
leaf: (value: T) => TT;
branch: (left: TT, right: TT) => TT;
}
interface Btree<T> {
<TT>(visitor: BtreeVisitor<T, TT>): TT;
}
const leaf = <T>(value: T): Btree<T> => {
@cb372
cb372 / riscv.md
Last active June 8, 2024 10:09
Writing an OS in Rust to run on RISC-V

(This is a translation of the original article in Japanese by moratorium08.)

(UPDATE (22/3/2019): Added some corrections provided by the original author.)

Writing your own OS to run on a handmade CPU is a pretty ambitious project, but I've managed to get it working pretty well so I'm going to write some notes about how I did it.

@Lucifier129
Lucifier129 / naive-json-parser.js
Last active December 23, 2020 23:15
a naive json parser implemented by parser combinator
// parser combinator
const fail = () => []
const failed = list => list.length === 0
const of = value => input => [value, input]
const bind = (parser, f) => input => {
let result = parser(input)
@Liam0205
Liam0205 / demo.tex
Last active June 17, 2024 09:48
demo of moderncv
%!TEX program = xelatex
% Font Size:
% 10pt, 11pt, 12pt
% Paper Size:
% a4paper, letterpaper, a5paper, leagalpaper, executivepaper, landscape
% Font Family:
% roman, sans
\documentclass[12pt, a4paper, roman]{moderncv}
% Style:
@rxaviers
rxaviers / gist:7360908
Last active June 27, 2024 04:33
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: