Skip to content

Instantly share code, notes, and snippets.

View CMCDragonkai's full-sized avatar

Roger Qiu CMCDragonkai

View GitHub Profile

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

CMCDragonkai /
Created August 30, 2018 14:05 — forked from XVilka/
True Colour (16 million colours) support in various terminal applications and terminals

Colours in terminal

It's a common confusion about terminal colours... Actually we have this:

  • plain ascii
  • ansi escape codes (16 colour codes with bold/italic and background)
  • 256 colour palette (216 colours + 16 ansi + 24 gray) (colors are 24bit)
  • 24bit true colour ("888" colours (aka 16 milion))
printf "\x1b[${bg};2;${red};${green};${blue}m\n"
CMCDragonkai / asciinema-to-scriptreplay
Created August 29, 2018 03:44 — forked from izabera/asciinema-to-scriptreplay
convert between asciinema and scriptreplay
exec {times}> times {typescript}> typescript < "${1-/dev/stdin}"
while read -r; do [[ $REPLY = ' "stdout": [' ]] && break; done # skip to this line
printf "Script started on %(%c)T\n" -1 >&"$typescript" # dummy
while read -r open; [[ $open = '[' ]]; do
read -r elapsed; read -r string; read -r close
eval printf %b%n "$string" characters >&"$typescript" # put count in $characters
printf "%s %s\n" "${elapsed%,}" "$characters" >&"$times"
{ config, pkgs, ... }:
imports = [ ./default.nix /root/nixcfg/core.nix ];
services = {
example = {
enable = true;
environment.systemPackages = with pkgs; [ wget tcpdump ltrace gdb ];
CMCDragonkai / install-comodo-ssl-cert-for-nginx.rst
Last active May 9, 2024 22:48 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

CMCDragonkai / curry.exs
Last active August 29, 2015 14:16 — forked from patrickgombert/gist:4737bb75d3983d2c6512
Elixir: Currying Macro 2
defmodule Curried do
defmacro defc({name, _, args}, [do: body]) do
curried_args =, fn({_, index}) ->
Enum.take(args, index + 1)
for a <- curried_args do
if a ==, Enum.count(curried_args) - 1) do
quote do
def unquote(name)(unquote_splicing(a)) do
CMCDragonkai / curry.exs
Last active March 15, 2018 16:11 — forked from charithe/curry.exs
Elixir: Currying Macro
defmodule Curry do
defmacro defcurry({func_name, _func_ctx, args}, do: body) do
num_args = Enum.count(args)
if num_args - 1 >= 1 do
new_args = Enum.take(args, num_args - 1)
quote do
def unquote(func_name)(unquote_splicing(args)) do