Skip to content

Instantly share code, notes, and snippets.

@simonliu009
simonliu009 / build-opencv-for-pyenv.py
Created April 1, 2022 03:27 — forked from pohmelie/build-opencv-for-pyenv.py
Build opencv for ubuntu 16.04 with pyenv
import pathlib
import sys
import sh
def clone_if_not_exists(name, url, **kwargs):
if not pathlib.Path(name).exists():
print("Cloning", url, "...")
sh.git.clone(url, name, depth=1, **kwargs)
@simonliu009
simonliu009 / KiCad
Last active October 12, 2021 00:39
[KiCad shortcuts]KiCad 快捷方式 #KiCad
原理图Schmatic:
Shift+A 放置元件 place components
M 移动元件
G 拖动连线
E 编辑属性
C 复制
R 旋转
X X轴镜像
Y Y轴镜像
Shift+L 标签
@simonliu009
simonliu009 / ledc.c
Last active July 1, 2021 05:35
ledc test code
/* LEDC (LED Controller) fade example
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/ledc.h"
@simonliu009
simonliu009 / youtube-dl.md
Created October 31, 2020 08:15 — forked from ryanlid/youtube-dl.md
youtube-dl 下载设置代理

socks5代理

youtube-dl --proxy socks5://127.0.0.1:1080 https://www.youtube.com/watch?v=6_gLU_OStK0

http代理

youtube-dl --proxy http://127.0.0.1:8118 https://www.youtube.com/watch?v=6_gLU_OStK0
@simonliu009
simonliu009 / aprintf
Created July 21, 2020 15:43 — forked from EleotleCram/aprintf
Simple arduino formatted printf
int aprintf(char *str, ...) {
int i, j, count = 0;
va_list argv;
va_start(argv, str);
for(i = 0, j = 0; str[i] != '\0'; i++) {
if (str[i] == '%') {
count++;
Serial.write(reinterpret_cast<const uint8_t*>(str+j), i-j);
/*
* Multiplexed SSD1306 Demo
* Copyright © 2018-01-02 tobozo
*
* https://github.com/tobozo
* https://twitter.com/tobozotagada
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the “Software”), to deal in
* the Software without restriction, including without limitation the rights to
@simonliu009
simonliu009 / Tornado webserver MJPEG streamer
Created March 26, 2020 17:26 — forked from mstaflex/Tornado webserver MJPEG streamer
Python Tornado webserver that streams JPEGs (in img/) as MJPEG-Stream using asynchronous timed callbacks (yields), being able to handly many different streams at the same time
import tornado.ioloop
import tornado.web
import gen
import time
import os
import tornado
file_list = os.listdir("img")
counter = 0
@simonliu009
simonliu009 / img.sh
Created March 5, 2020 12:58
[shell脚本批量修改]#shell #scripts #脚本
#!/bin/bash
#Function:rename files
#Created by xiaoyu
mname=0 #声明变量
for file in `ls` #遍历当前目录下的所有文件
do
fname=${file:0:1} #截取文件名的前1个字符
bname=${file:0-8} #截取文件名的后8个字符
let "mname = mname + 1"
filename=$fname$mname$bname #拼接最终文件名
@simonliu009
simonliu009 / emacs cua-mode
Last active February 27, 2020 04:34
[emacs cua-mode 列编辑]#emacs
原始列模式
emacs以C-x r开头的命令来进行矩形操作。先用C-space或者C-@设一个mark,移动光标到另一点,用以下命令进行列操作:
C-x r k 剪切一个矩形块
C-x r y 粘贴一个矩形块
C-x r o 插入一个矩形块
C-x r c 清除一个矩形块(使其变成空白)
@simonliu009
simonliu009 / emacs key binding 快捷键
Last active February 27, 2020 04:15
emacs: key binding 快捷键 #emacs #快捷键
C-g : 取消当前操作
C-x u : undo
光标向下移动一行 C-n
光标向上移动一行 C-p
光标向上移动一页 C-x [
光标向下移动一页 C-x ]
C-v : 向下翻页
M-v : 向上翻页