Skip to content

Instantly share code, notes, and snippets.

View linw1995's full-sized avatar
🎯
Focusing

林玮 (Jade Lin) linw1995

🎯
Focusing
View GitHub Profile
@0atman
0atman / configuration.nix
Last active November 15, 2024 13:06
A rebuild script that commits on a successful build
{
config,
pkgs,
options,
...
}: let
hostname = "oatman-pc"; # to alllow per-machine config
in {
networking.hostName = hostname;
@mondaychen
mondaychen / 关于开发者效率和裁员的闲聊.md
Last active October 22, 2024 05:47
关于开发者效率和裁员的闲聊

关于开发者效率和裁员的闲聊

前一阵,我写了一篇文章,其中聊到了 React 团队在 Meta 不受重视、难以得到资源的问题。这篇文章引起了很多同行的共鸣。今天,我有一些新的想法想要聊聊。

开发者效率的价值多在成长期的业务中体现

其实,这个问题不仅限于 React,很多开发者工具、框架、编程语言等,都符合这个规律。这些工程团队在公司快速发展时是被认为对公司发展很有意义的,但随着时间的推移,公司对这些团队的重视程度似乎在逐渐减少。

这类团队的工作内容大致可以分为两类:一类是必须有他们才能实现的某些产品的重要功能;另一类是通过他们的工作,可以使公司用更少的开发者完成本需要更多人手才能完成的产品。这两者有一个重要的共同点,那就是“新”:新产品、新功能、新内容。显然,在一家公司的业务高速发展的时候,会有很多这样的需求。但当业务进入成熟的业务阶段时,对这类工作的需求就会减少。

在那篇文章中,我提到这类团队的工作往往难以量化。现在想来,无法量化只是表面的原因。实际上,很多很难量化其效果的工作,如广告投放,仍然会得到公司巨量的资源投入。另一方面,很多平台工程团队都尝试过各种方法来量化他们的工作产出,比如说,他们会声称原先每年需要30个工程师的研发工作,现在只需要15个人,为公司节省了相当于每年15个工程师的成本。

@chetan
chetan / dumpcerts.traefik.v2.sh
Created November 9, 2023 16:24
Convert traefik acme.json to PEM files
#!/usr/bin/env bash
# Copyright (c) 2017 Brian 'redbeard' Harrington <[email protected]>
#
# dumpcerts.sh - A simple utility to explode a Traefik acme.json file into a
# directory of certificates and a private key
#
# Usage - dumpcerts.sh /etc/traefik/acme.json /etc/ssl/
#
# Dependencies -
# util-linux
@mdvorak
mdvorak / BTT_Pi_DS18B20.md
Last active May 27, 2024 09:48
DS18B20 on BigTreeTech Pi
@mrballcb
mrballcb / rancher_desktop_BIP.txt
Last active April 6, 2023 08:46
Configure Rancher Desktop 1.0.0 to use a custom bridge IP on Mac
# This will survive restarts of Rancher Desktop. I don't expect it to survive "Reset Kubernetes" actions.
# This will get a shell inside the running VM.
# Many thanks to Jan Dubois, this one liner replaced a complicated set of commands I had here earlier.
LIMA_HOME="$HOME/Library/Application Support/rancher-desktop/lima" limactl shell 0
sudo su -
vi /etc/conf.d/docker
# Add to the DOCKER_OPTS cli the bip and subnet you want. I picked a very small /24 at the end of the 172.16/20 space:
from bcc import BPF
import ctypes
bpf_text ="""
#include <linux/ptrace.h>
#include <linux/sched.h> /* For TASK_COMM_LEN */
#include <linux/icmp.h>
#include <linux/ip.h>
#include <linux/netdevice.h>
#ifndef lazy_memory_h
#define lazy_memory_h
#include <stdint.h>
#include <string.h>
#define CacheLine 64
#define WordSize (sizeof(uint64_t) * 8) // 64 (bits)
#define AlignN(s, n) (( s + n - 1) / n * n)
@frostming
frostming / promise.py
Last active June 16, 2024 18:17
Python implementation of JavaScript's Promise interface
"""
Python implementation of JavaScript's Promise interface
with the power of asyncio.
See https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Promise
for the API specification.
Authored by: Frost Ming <[email protected]>
License: WTFPL
"""
@kemingy
kemingy / client.py
Last active June 17, 2024 08:49
unix domain socket vs. multiprocessing transfer time
import socket
import numpy as np
import pickle
import time
import struct
matrix = np.random.random((224, 224, 3))
socket_path = './uds.sock'
@ackerleytng
ackerleytng / .zprofile
Last active January 3, 2023 13:50
zsh config
if systemctl -q is-active graphical.target && [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then
exec startx
fi