Skip to content

Instantly share code, notes, and snippets.

View staticor's full-sized avatar

SteveYagn staticor

View GitHub Profile
@staticor
staticor / Apple_mobile_device_types.txt
Created November 28, 2022 03:35 — forked from adamawolf/Apple_mobile_device_types.txt
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@staticor
staticor / install_protobuf2.5_on_ubuntu.md
Created September 18, 2022 04:28 — forked from ddupg/install_protobuf2.5_on_ubuntu.md
install protobuf 2.5 on ubuntu
wget https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz
tar xvf protobuf-2.5.0.tar.gz
cd protobuf-2.5.0
./autogen.sh
./configure --prefix=/usr
make
sudo make install
protoc --version
@staticor
staticor / hhkb.md
Last active June 2, 2022 06:04 — forked from mitoop/hhkb.md
HHKB Type-S vs Filco Minila

HHKB

蓝牙连接

既然是双模版,自然就有“有线连接”和“蓝牙连接”这2种方式。

有线连接比较直白,就是插上Type-C线,另一头连上电脑,然后长按电源键打开键盘,并且通过组合键Fn+Control+0切换到有线模式即可。

而对于蓝牙连接,在开启键盘后,如果键盘指示灯是蓝色常亮,我们需要通过组合键:Fn+Q或点按一下电源键进入蓝牙配对模式,指示灯也会如下图这样开始闪烁。

接着再输入Fn+Control+1、2、3、4(四选一),指定一个未使用的蓝牙设备序号。这时闪烁速度会加快,键盘进入待配对模式。

@staticor
staticor / Trie.java
Created May 17, 2022 08:54
字典树简易实现
import java.util.TreeMap;
public class Trie {
private static class Node{
public boolean isWord;
@staticor
staticor / ConsumerExample.scala
Created June 10, 2021 13:21 — forked from fancellu/ConsumerExample.scala
Kafka Producer/Consumer Example in Scala
import java.util
import org.apache.kafka.clients.consumer.KafkaConsumer
import scala.collection.JavaConverters._
object ConsumerExample extends App {
import java.util.Properties
# Rime schema
# encoding: utf-8
schema:
schema_id: double_pinyin_flypy
name: 小鶴雙拼
version: "0.18"
author:
- double pinyin layout by 鶴
- Rime schema by 佛振 <chen.sst@gmail.com>
@staticor
staticor / du.sh
Created January 6, 2021 04:07 — forked from joostvanveen/du.sh
Get folder sizes on command line, including --max-depth, sorted by folder size desc
# Get available disk space
df -h
# Get the top 10 biggest folders in the current directory
du -h --max-depth=1 | sort -rh | head -10
# Get the top 10 biggest folders in the current directory and their first child directories
du -h --max-depth=2 | sort -rh | head -10
# Get sizes of all folders in the current directory
@staticor
staticor / why-curry-helps.md
Created July 30, 2020 13:03 — forked from jcouyang/why-curry-helps.md
为什么要柯里化(why-curry-helps)slide http://git.io/why-curry-helps 📈

还记得 Haskell Curry吗,

多巧啊, 人家姓 Curry 名 Haskell, 难怪 Haskell 语言会自动柯里化, 呵呵. 但是不奇怪吗, 为什么要柯里化呢. 为什么如此重要导致 Haskell 会默认自动柯里化所有函数, 不就是返回一个部分配置好的函数吗.

我们来看一个 Haskell 的代码.

max 3 4
(max 3) 4
@staticor
staticor / .screenrc
Created December 5, 2019 12:33 — forked from mosquito/.screenrc
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
#
# /etc/screenrc
#
# This is the system wide screenrc.
#
# You can use this file to change the default behavior of screen system wide
# or copy it to ~/.screenrc and use it as a starting point for your own
# settings.
@staticor
staticor / Pascall-Triangle.py
Created October 17, 2019 23:37
Leetcode一些编程小练习
class Solution:
def getRow(self, rowIndex: int) -> List[int]:
if rowIndex < 0:
return []
ans = [1]*(rowIndex+1)
for i in range(rowIndex):
ans[i+1] = ans[i]*(rowIndex-i)//(i+1)
return ans