Skip to content

Instantly share code, notes, and snippets.

View xiaoxiangmoe's full-sized avatar
๐Ÿฐ
busy

ZHAO Jin-Xiang xiaoxiangmoe

๐Ÿฐ
busy
View GitHub Profile
@jackyliu16
jackyliu16 / flake.nix
Last active October 26, 2024 17:49
A flake of nix for rCore
{
description = "A devShell for rCore";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-qemu7.url = "https://github.com/NixOS/nixpkgs/archive/7cf5ccf1cdb2ba5f08f0ac29fc3d04b0b59a07e4.tar.gz";
rust-overlay.url = "github:oxalica/rust-overlay";
flake-utils.url = "github:numtide/flake-utils";
};
@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 January 26, 2025 06:23
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 April 9, 2025 19:53
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 May 11, 2025 13: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 May 19, 2025 04:38
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: