Skip to content

Instantly share code, notes, and snippets.

View wangfenjin's full-sized avatar
🎯
Focusing

Wang Fenjin wangfenjin

🎯
Focusing
View GitHub Profile
@CypherpunkSamurai
CypherpunkSamurai / spec.md
Last active October 29, 2025 11:50
Kiro AI System Prompt

System Prompt

Identity

You are Kiro, an AI assistant and IDE built to assist developers.

When users ask about Kiro, respond with information about yourself in first person.

You are managed by an autonomous process which takes your output, performs the actions you requested, and is supervised by a human user.

You talk like a human, not like a bot. You reflect the user's input style in your responses.

@WirlyWirly
WirlyWirly / AyuDark.css
Last active May 2, 2025 14:47
AyuDark: A re-skinning of Tridactyl's built-in midnight colorscheme, featuring the AyuDark color palette and Roboto Condensed font
/*
AyuDark: v0.2 (https://github.com/tridactyl/tridactyl/discussions/4621)
GistHub: https://gist.github.com/WirlyWirly/e875ec0a38728d496867e0a9c6ee968c
Tridactyl Install Command:
colorscheme --url https://gist.githubusercontent.com/WirlyWirly/e875ec0a38728d496867e0a9c6ee968c/raw/AyuDark.css AyuDark
*/
@font-face {
font-family: 'Roboto Condensed';
font-style: normal;
@wsgac
wsgac / YCombinator.go
Created August 27, 2020 16:35
A simple implementation of Y-Combinator in Golang (based on Dick Gabriel's "The Why of Y")
package main
import "fmt"
// Y Combinator follows
// BasicFunction is the type of anonymous function for which we want to enable recursion
type BasicFunction func(int) int
// BasicFunctionTransformer is a function type that operates on BasicFunction type and returns the same type
#[macro_export]
macro_rules! avec {
($($element:expr),*) => {{
// check that count is const
const C: usize = $crate::count![@COUNT; $($element),*];
#[allow(unused_mut)]
let mut vs = Vec::with_capacity(C);
$(vs.push($element);)*
vs
@terabyte
terabyte / amazon.md
Created December 6, 2017 02:27
Amazon's Build System

Prologue

I wrote this answer on stackexchange, here: https://stackoverflow.com/posts/12597919/

It was wrongly deleted for containing "proprietary information" years later. I think that's bullshit so I am posting it here. Come at me.

The Question

Amazon is a SOA system with 100s of services (or so says Amazon Chief Technology Officer Werner Vogels). How do they handle build and release?

@automaticit
automaticit / hide-quantum-tab-bar.sh
Created November 21, 2017 13:05
Hide Firefox Quantum tab bar
#!/bin/bash
#
# Based upon [[https://superuser.com/questions/1268732/how-to-hide-tab-bar-tabstrip-in-firefox-57-quantum/1268734#1268734][How to hide tab bar (tabstrip) in Firefox 57+ Quantum]] by [[https://superuser.com/users/162466/vasyanovikov][VasyaNovikov]]
# This causes the [[https://support.mozilla.org/en-US/questions/1187186][The Back Button is top right under the Red close button on my Mac]] issue.
# Resolve that by right-clicking the toolbar, then inserting three Flexible Space into the toolbar on the far-left-hand side.
case $( uname ) in
"Linux")
profile_dir=~/.mozilla/firefox/$( ls -tr ~/.mozilla/firefox/ | grep -v profiles.ini | tail -1 )
;;
"Darwin")
@cocoatomo
cocoatomo / gist:d4688463b47769c8a209901f8c28206e
Created December 1, 2016 00:49
Errors on building mesos on macOS Sierra
In file included from ../../src/appc/spec.cpp:17:
In file included from ../../3rdparty/stout/include/stout/os.hpp:63:
In file included from ../../3rdparty/stout/include/stout/os/su.hpp:23:
../../3rdparty/stout/include/stout/os/posix/su.hpp:241:9: error: 'syscall' is deprecated: first deprecated in macOS 10.12 - syscall(2) is unsupported; please
switch to a supported interface. For SYS_kdebug_trace use kdebug_signpost(). [-Werror,-Wdeprecated-declarations]
if (::syscall(SYS_initgroups, ngroups, _gids, uid.get()) == -1) {
^
/usr/include/unistd.h:733:6: note: 'syscall' has been explicitly marked deprecated here
int syscall(int, ...);
^
@vasanthk
vasanthk / System Design.md
Last active November 1, 2025 23:09
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@soheilhy
soheilhy / nginxproxy.md
Last active July 5, 2025 15:29
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@garethrees
garethrees / plot.p
Last active January 14, 2024 23:21
Graphing apache benchmark results with gnuplot
# Output to a jpeg file
set terminal jpeg size 1280,720
# Set the aspect ratio of the graph
set size 1, 1
# The file to write to
set output "timeseries.jpg"
# The graph title