Skip to content

Instantly share code, notes, and snippets.

View secondwtq's full-sized avatar

Second Datke secondwtq

  • Sichuan University
  • China
View GitHub Profile
@lattner
lattner / TaskConcurrencyManifesto.md
Last active June 8, 2024 03:41
Swift Concurrency Manifesto
@pakoito
pakoito / KECS.hs
Created May 21, 2017 13:27
Kind ECS
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
data family Component a :: *
data instance Component Health = HealthC
data instance Component Stamina = StaminaC
@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active June 10, 2024 01:49
Hyperlinks in Terminal Emulators
@lexi-lambda
lexi-lambda / Main.hs
Last active July 5, 2023 18:01
Minimal Haskell implementation of Complete and Easy Bidirectional Typechecking for Higher-Rank Polymorphism
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Language.HigherRank.Main
( Expr(..)
, EVar(..)
, Type(..)
, TVar(..)
, TEVar(..)
, runInfer
) where
{-# LANGUAGE FlexibleInstances #-}
-- | An implementation of Section 3, Local Type Argument Synthesis, from the
-- paper /Local Type Inference/ by Pierce and Turner.
module Infer where
import Control.Monad (foldM, join, zipWithM)
import Data.Function (on)
import Data.List (foldl', groupBy, intercalate, intersect, nub)
@hediet
hediet / main.md
Last active March 11, 2024 15:05
Proof that TypeScript's Type System is Turing Complete
type StringBool = "true"|"false";


interface AnyNumber { prev?: any, isZero: StringBool };
interface PositiveNumber { prev: any, isZero: "false" };

type IsZero<TNumber extends AnyNumber> = TNumber["isZero"];
type Next<TNumber extends AnyNumber> = { prev: TNumber, isZero: "false" };
type Prev<TNumber extends PositiveNumber> = TNumber["prev"];
http://www.anandtech.com/show/11170/the-amd-zen-and-ryzen-7-review-a-deep-dive-on-1800x-1700x-and-1700/6
"The High-Level Zen Overview"
- "Features such as the micro-op cache help most instruction streams improve in performance and bypass parts of potentially
long-cycle repetitive operations, but also the larger dispatch, larger retire, larger schedulers and better branch
prediction means that higher throughput can be maintained longer and in the fastest order possible."
Micro-op caches have nothing to with "bypassing parts of potentially long-cycle repetitive operations" (what does
that even mean?). They reduce decode bottlenecks and decrease power consumption. Depending on the implementation,
@bkaradzic
bkaradzic / why_i_think_immediate_mode_gui_is_way_to_go_for_gamedev_tools.md
Last active April 5, 2024 05:40
Why I think Immediate Mode GUI is way to go for GameDev tools

Why I think Immediate Mode GUI is way to go for GameDev tools

Prerequisites

Before you continue, if you don't know what IMGUI is don't bother reading this post, just ignore it, don't write anything in comments section, etc. If you're curious about IMGUI see bottom of this post, otherwise continue whatever you were doing, this post it's not for you. Thanks!

If you know what IMGUI is, for context read following presentations and blog posts:

  • Insomniac’s Web Tools Postmortem
@afc163
afc163 / cascader-address-options.js
Last active December 14, 2023 01:47
Address options for antd cascader
import provinces from 'china-division/dist/provinces.json';
import cities from 'china-division/dist/cities.json';
import areas from 'china-division/dist/areas.json';
areas.forEach((area) => {
const matchCity = cities.filter(city => city.code === area.cityCode)[0];
if (matchCity) {
matchCity.children = matchCity.children || [];
matchCity.children.push({
label: area.name,
# List of plugins
set -g @plugin 'tmux-plugins/tmux-sidebar'
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'git@github.com/user/plugin'
# set -g @plugin 'git@bitbucket.com/user/plugin'