Skip to content

Instantly share code, notes, and snippets.

View zthxxx's full-sized avatar
🐾
Nyaa~

zthxxx zthxxx

🐾
Nyaa~
View GitHub Profile
@emanuelez
emanuelez / git_speed.md
Last active March 17, 2024 19:03
Git Speed

How Fast is Git?

The web is full of benchmarks showing the supernatural speed of Git even with very big repositories, but unfortunately they use the wrong variable. Size is not important, but the number of files in the repository really is!

Why is that? Well, that's because Git works in a very different way compared to Synergy. You don't have to checkout a file in order to edit it; Git will do that for you automatically. But at what price?

The price is that for every Git operation that requires to know which files changed (git status, git commmit, etc etc) an lstat() call will be executed for every single file

Wow! So how does that perform on a fairly large repository? Let's find out! For this example I will use an example project, which has 19384 files in 1326 folders.

@staltz
staltz / introrx.md
Last active May 2, 2024 12:31
The introduction to Reactive Programming you've been missing
@pfreixes
pfreixes / Gevent vs asyncio with libuv.md
Last active May 16, 2021 08:17
Gevent vs asyncio with libuv

The numbers claimed by this benchamark about Gevent [1] comparaed with the numbers got by Asyncio with the uvloop and even with the default loop has left me a bit frozen. Ive repeated a few of them : gevent, asyncio, asyncio-uvloop and go for the echo server and these are the numbers roughly:

For gevent

$ ./echo_client
685393 0.98KiB messages in 30 seconds
Latency: min 0.04ms; max 4.48ms; mean 0.126ms; std: 0.048ms (37.68%)
Latency distribution: 25% under 0.088ms; 50% under 0.122ms; 75% under 0.158ms; 90% under 0.182ms; 99% under 0.242ms; 99.99% under 0.91ms
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active May 1, 2024 22:04
crack activate Office on mac with license file
@zthxxx
zthxxx / .screenrc
Last active November 8, 2023 16:02
screen preference
# Install
# curl -sL https://gist.github.com/zthxxx/df7e121048b12c80f260285d88e1091f/raw/.screenrc -o ~/.screenrc
# curl -s https://gist.githubusercontent.com/zthxxx/df7e121048b12c80f260285d88e1091f/raw/.screenrc -o ~/.screenrc
# Shortcut Key binding
# https://www.gnu.org/software/screen/manual/screen.html#Bindkey
# remap prefix key `Ctrl-A` to `Ctrl-S`
@zthxxx
zthxxx / kill-SymDaemon.sh
Last active December 14, 2022 07:59
stop and kill Symantec daemon on macOS
#!/usr/bin/env bash
# curl -o- https://gist.githubusercontent.com/zthxxx/607b8793885197ff61fb79a3d9db25cb/raw/kill-SymDaemon.sh | bash
launchctl unload /Library/LaunchAgents/com.symantec.uiagent.application.*plist
sudo launchctl unload /Library/LaunchDaemons/com.symantec.*.plist
sudo rm -rf /Library/LaunchAgents/com.symantec.uiagent.application.*plist /Library/LaunchDaemons/com.symantec.*.plist
ps -ef | grep -i symantec
@zthxxx
zthxxx / colorsheet.zsh
Last active November 24, 2021 08:07
display 256 colors in terminal
# print 256-color pattern
function sheet:color {
local block row col fg_color bg_color
local i
print -P "$(
echo -n '\n'
# the 16 base colors
for i in {0..15}; do
@Jack-Works
Jack-Works / 2018.js
Last active March 1, 2024 02:23
cRAzY eSnEXt (*all* proposals mixed in)
#! Aaaaaaaaaaa this is JS!!!
// https://github.com/tc39/proposal-hashbang
// This file is mixing all new syntaxes in the proposal in one file without considering syntax conflict or correct runtime semantics
// Enjoy!!!
// Created at Nov 23, 2018
for await(const x of (new A // https://github.com/tc39/proposal-pipeline-operator
|> do { // https://github.com/tc39/proposal-do-expressions
case(?) { // https://github.com/tc39/proposal-pattern-matching
when {val}: class {
@sindresorhus
sindresorhus / esm-package.md
Last active May 2, 2024 22:22
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.