Skip to content

Instantly share code, notes, and snippets.

View ziyunli's full-sized avatar
:shipit:
shipit

Ziyun "Stephen" Li ziyunli

:shipit:
shipit
View GitHub Profile
@ziyunli
ziyunli / transcript.txt
Created July 21, 2023 22:15
gZuG4Yng4bY
Hello Diablo community, welcome to another Diablo 4 Campfire Chat. My name is Adam Fletcher, I am the Associate Director of Community here for Diablo. I'm joined here by Joe Shelley, Game Director of Diablo 4, and Mr. Joe Paipora, the Associate Game Director for Diablo 4. We have a lot to talk about today. Obviously we have this Campfire Chat because we do want to talk about the patch that just released this past week, which is patch 1.1.0. We've seen a ton of feedback, we've heard a lot of feedback, and so we do want to go through a lot of the points of feedback that we've been hearing and at the same time the patch itself. The biggest thing to kick us off here, I think we want to obviously acknowledge everyone's feedback in regards to reducing player power. We know it is bad, we know it is not fun, and it's something that we ourselves know that it's not the greatest play experience for players out there. We do want to explain why we ended up doing it within the actual patch, and then of course we also want
@ziyunli
ziyunli / dedup.py
Created July 5, 2022 01:28
OneTab Operations
with open('onetab.txt', encoding="utf-8") as f:
with open('dedup.txt', 'w', encoding="utf-8") as out:
links = {}
is_linebreak = False
for line in f:
line = line.strip()
if not line:
if not is_linebreak:
out.write('\n')
is_linebreak = True
@ziyunli
ziyunli / clean-git-branches.sh
Created November 21, 2019 16:07
Clean up invalid git branches
#!/bin/sh
# From https://stackoverflow.com/a/28319271
set -e
if [ $# -eq 0 ]; then
dir="."
else
dir="$1"
@ziyunli
ziyunli / index.md
Created October 25, 2019 17:18 — forked from bojand/index.md
gRPC and Load Balancing

Just documenting docs, articles, and discussion related to gRPC and load balancing.

https://github.com/grpc/grpc/blob/master/doc/load-balancing.md

Seems gRPC prefers thin client-side load balancing where a client gets a list of connected clients and a load balancing policy from a "load balancer" and then performs client-side load balancing based on the information. However, this could be useful for traditional load banaling approaches in clound deployments.

https://groups.google.com/forum/#!topic/grpc-io/8s7UHY_Q1po

gRPC "works" in AWS. That is, you can run gRPC services on EC2 nodes and have them connect to other nodes, and everything is fine. If you are using AWS for easy access to hardware then all is fine. What doesn't work is ELB (aka CLB), and ALBs. Neither of these support HTTP/2 (h2c) in a way that gRPC needs.

@ziyunli
ziyunli / pgcli
Created February 28, 2019 15:23
configs
# vi: ft=dosini
[main]
# Enables context sensitive auto-completion. If this is disabled the all
# possible completions will be listed.
smart_completion = True
# Display the completions in several columns. (More completions will be
# visible.)
wider_completion_menu = False

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

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

def longest_exp_inc_seq(a):
"""
>>> longest_exp_inc_seq([0, 4, 8, 2, 1, 3, 7, 15, 2, 9, 7])
[0, 1, 3, 7, 15]
"""
if len(a) == 0:
return a
s = [1] * len(a) # the longest subsequence that ends at i
p = [-1] * len(a) # the index of the previous element in the longest subsequence at i
@ziyunli
ziyunli / company-ownership.md
Created July 6, 2016 13:39 — forked from jdmaturen/company-ownership.md
Who pays when startup employees keep their equity?

Who pays when startup employees keep their equity?

JD Maturen, 2016/07/05, San Francisco, CA

As has been much discussed, stock options as used today are not a practical or reliable way of compensating employees of fast growing startups. With an often high strike price, a large tax burden on execution due to AMT, and a 90 day execution window after leaving the company many share options are left unexecuted.

There have been a variety of proposed modifications to how equity is distributed to address these issues for individual employees. However, there hasn't been much discussion of how these modifications will change overall ownership dynamics of startups. In this post we'll dive into the situation as it stands today where there is very near 100% equity loss when employees leave companies pre-exit and then we'll look at what would happen if there were instead a 0% loss rate.

What we'll see is that employees gain nearly 3-fold, while both founders and investors – particularly early investors – get dilute

@ziyunli
ziyunli / letsencrypt_2016.md
Created May 18, 2016 00:25 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two modes when you don't want Certbot to edit your configuration:

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80) to renew certificates.

In the following, we're setting up mydomain.com to be served from /var/www/mydomain, and challenges will be served from /var/www/letsencrypt.