Skip to content

Instantly share code, notes, and snippets.

Avatar
🇭🇰

QuantumGhost QuantumGhost

🇭🇰
View GitHub Profile
View log_test.go
package temp
import (
"fmt"
"github.com/rs/zerolog"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"io/ioutil"
"testing"
@QuantumGhost
QuantumGhost / disable-macos-notarization.md
Created May 9, 2020
disable notarization on macOS Catalina
View disable-macos-notarization.md

Catalina's notarization is a disaster for cli apps. You may like to disable it with the following command:

sudo spctl --master-disable
View 20111011_SteveYeggeGooglePlatformRant.md

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

View uBlacklist.txt
*://*.cengji.com/*
*://*.kknews.cc/*
*://read01.com/*
*://blog.csdn.net/*
*://help.aliyun.com/wordpower/*
*://cloud.tencent.com/developer/information/*
*://www.liankexing.com/*
@QuantumGhost
QuantumGhost / DefaultKeyBinding.dict
Last active Dec 15, 2019 — forked from smilingpoplar/DefaultKeyBinding.dict
xcode keybindings for emacs emulation
View DefaultKeyBinding.dict
{
/* Override symbols so other apps can bind */
/* ~ stands for option, ^ stands for control */
"~j" = "noop:";
"~i" = "noop:";
"~;" = "noop:";
"~a" = "noop:";
"~2" = "noop:";
"~g" = "noop:";
"~y" = "noop:";
View http api and error code.md

采取 RESTful 风格的 api 是否应该对结果包一层?

又是基于 HTTP 的 API 设计问题

我个人的想法是:

  1. RESTful 和 RPC 风格各有优劣,具体场景具体分析,但是整体一致最重要,不一致的 API 始终是最糟糕的。

  2. 如果要添加错误码,错误码最好放在 HTTP 头里面,这样可以在不读取 payload 的情况下判断是否存在错误

    例如:X-Error-Code: 10001 或者 X-Error-Code: OUT_OF_CREDIT

@QuantumGhost
QuantumGhost / AnIntro.md
Created Oct 10, 2019 — forked from chrisdone/AnIntro.md
Statically Typed Lisp
View AnIntro.md

Basic unit type:

λ> replTy "()"
() :: ()

Basic functions:

View rust-in-large-organizations-notes.md

Rust in Large Organizations

Initially taken by Niko Matsakis and lightly edited by Ryan Levick

Agenda

  • Introductions
  • Cargo inside large build systems
  • FFI
  • Foundations and financial support
@QuantumGhost
QuantumGhost / chez-future.ss
Created Aug 31, 2019 — forked from yinwang0/chez-future.ss
experimental implementation of future with Chez Scheme threads
View chez-future.ss
(define-record fitem (result ready mutex cond))
(define future
(lambda (thunk)
(let ([item (make-fitem #f #f (make-mutex) (make-condition))])
(fork-thread
(lambda ()
(let ([result (thunk)])
(with-mutex (fitem-mutex item)
(set-fitem-result! item result)
View zfs_repo_setup.sh
#!/usr/bin/env bash
CODENAME=buster
APT_MIRROR=https://mirrors.ustc.edu.cn/debian
cat <<EOF | tee /etc/apt/sources.list.d/zfs.list
deb ${APT_MIRROR} ${CODENAME}-backports main contrib
deb-src ${APT_MIRROR} ${CODENAME}-backports main contrib
EOF
You can’t perform that action at this time.