Skip to content

Instantly share code, notes, and snippets.

View ichengzi's full-sized avatar

chengzi ichengzi

View GitHub Profile
View react-js-how-to-append-a-component-on-click
import React from 'react';
import ReactDOM from 'react-dom';
class AppComponent extends React.Component {
state = {
numChildren: 0
render () {
ichengzi / Base64Url.cs
Created July 19, 2022 12:08 — forked from igorushko/Base64Url.cs
Base64Url C#
View Base64Url.cs
public static class Base64Url
public static string Encode(byte[] arg)
if (arg == null)
throw new ArgumentNullException("arg");
var s = Convert.ToBase64String(arg);
ichengzi / winnt.h
Created October 10, 2020 13:23 — forked from JamesMenetrey/winnt.h
WinNT.h in Windows 10 SDK (10.0.17763.0)
View winnt.h
/*++ BUILD Version: 0073 Increment this if a change has global effects
Copyright (c) Microsoft Corporation. All rights reserved.
Module Name:
ichengzi / Mac Classic.tmTheme
Created April 24, 2020 03:30 — forked from Arc0re/Mac Classic.tmTheme
Mac Classic theme for Sublime Text 3. To install under v3.2.1 ( build 3207 ): Preferences > Browse Packages... > new folder called "Mac Classic.tmTheme", copy .tmTheme file in there. The colorscheme will be instantly added to Sublime's list.
View Mac Classic.tmTheme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "">
<plist version="1.0">
<string>Chris Thomas</string>
<string>Mac Classic</string>
ichengzi / create-new-file.ahk
Created April 22, 2016 15:05
AutoHotKey: Create a new file with Ctrl+Alt+N keyboard shortcut in Windows Explorer
View create-new-file.ahk
; This is part of my AutoHotKey [1] script. When you are in Windows Explorer it
; allows you to press Ctrl+Alt+N and type a filename, and that file is created
; in the current directory and opened in the appropriate editor (usually
; [gVim]( in my case, but it will use whatever program is
; associated with the file in Windows Explorer).
; This is much easier than the alternative that I have been using until now:
; Right click > New > Text file, delete default filename and extension (which
; isn't highlighted in Windows 7), type the filename, press enter twice.
; (Particularly for creating dot files like ".htaccess".)
ichengzi / latency.txt
Created January 17, 2016 06:26 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
View latency.txt
Latency Comparison Numbers
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
ichengzi / Program.cs
Last active September 19, 2015 12:56
Xaml Console Printer
View Program.cs
namespace XamlConsolePrinter
using System.Printing;
using System.Threading;
using System.Threading.Tasks;
using System.Threading.Tasks.Schedulers;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Xps;
View WindowsMessage.cs
namespace NAMESPACE
public enum WindowsMessage
WM_NULL = 0x0000,
WM_CREATE = 0x0001,
WM_DESTROY = 0x0002,
WM_MOVE = 0x0003,
WM_SIZE = 0x0005,
WM_ACTIVATE = 0x0006,