Skip to content

Instantly share code, notes, and snippets.

message Page {
message Resource {
oneof id {
string sku = 1;
string product = 2;
string collection = 3;
string product_type = 4;
string brand = 5;
// page id indicates another page in the same storefront
.mtk5 {
font-family: "Fira Code";
}
@idy
idy / monorepo.md
Created March 28, 2017 14:39 — forked from arschles/monorepo.md
Why We Should Use Monolithic Repositories

I think we should have all our code in a monolithic repository.

I've detailed the big benefits to having one, addressed possible issues to having one, and mentioned a few risks to not moving to a monorepo below.

Benefits To Adopting a Monolithic Repo

Golang package dependencies

  1. Single vendor/ dir at the top level of deis/deis
  2. All internal packages use the same external dependencies
@idy
idy / create_ipset.sh
Created August 26, 2015 05:22
create ipset from isp cidr txt
ipset destroy;
for isp in ./*.txt; > ipset.sh
do
isp_name=`basename $isp .txt`;
echo "#$isp_name";
echo "ipset create $isp_name hash:net";
for cidr in `cat $isp`;
do
echo "ipset add $isp_name $cidr";
done;
@idy
idy / luna_pinyin.custom.yaml
Last active August 29, 2015 14:27 — forked from lotem/luna_pinyin.custom.yaml
在 Rime 中加入"["和"]"翻页按键绑定(以【明月拼音】为例)
# luna_pinyin.custom.yaml
# save it to:
# ~/.config/ibus/rime (linux)
# ~/Library/Rime (macos)
# %APPDATA%\Rime (windows)
patch:
"key_binder/bindings":
- { when: paging, accept: bracketleft, send: Page_Up }
- { when: has_menu, accept: bracketright, send: Page_Down }
$ vi /etc/sysctl.conf
# 系统所有进程一共可以打开的文件数量, 每个套接字也占用一个文件描述字
fs.file-max = 1491124
# 系统同时保持TIME_WAIT套接字的最大数目,http 短链接会产生很多 TIME_WAIT 套接字。
net.ipv4.tcp_max_tw_buckets = 7000
# 关闭 tcp 来源跟踪
net.ipv4.conf.default.accept_source_route = 0
# 缩短套接字处于 TIME_WAIT 的时间, 60s -> 30s
net.ipv4.tcp_fin_timeout = 30
# 启用 TIME_WAIT 复用,使得结束 TIEM_WAIT 状态的套接字的端口可以立刻被其他套接字使用。
@idy
idy / tcpdump.sh
Last active August 29, 2015 14:19
pcap filter to seperate inbound and outbound packages
#!/bin/bash
tcpdump not src host 192.168
@idy
idy / re-sign-ipa.sh
Created December 9, 2014 06:56
Use codesign re-sign swift app
#!/bin/sh
# Usage: ./sign.sh INPUT.ipa OUTPUT PROVISION.mobileprovision IDENTITY_NAME ENTITLEMENTS
# Reading parameters
INPUT=$1
OUTPUT=$2.ipa
MOBILE_PROVISTION=$3
CER_NAME=$4
# ENTITLEMENTS=$5