Skip to content

Instantly share code, notes, and snippets.

View zrt's full-sized avatar
🐟
摸鱼中

Ruotian Zhang zrt

🐟
摸鱼中
View GitHub Profile
@zrt
zrt / webcryptoapi.html
Created April 26, 2022 14:47 — forked from deiu/webcryptoapi.html
Web Crypto API example: RSA keygen & export & import & sign & verify & encrypt & decrypt
<!-- MIT License -->
<html>
<head>
<script>
function generateKey(alg, scope) {
return new Promise(function(resolve) {
var genkey = crypto.subtle.generateKey(alg, true, scope)
genkey.then(function (pair) {
resolve(pair)
})
@zrt
zrt / processing_teapot2.pde
Created April 9, 2020 14:18
arduino with 2x mpu6050
// I2C device class (I2Cdev) demonstration Processing sketch for MPU6050 DMP output
// 6/20/2012 by Jeff Rowberg <jeff@rowberg.net>
// Updates should (hopefully) always be available at https://github.com/jrowberg/i2cdevlib
//
// Changelog:
// 2012-06-20 - initial release
/* ============================================
I2Cdev device library code is placed under the MIT license
Copyright (c) 2012 Jeff Rowberg
@zrt
zrt / Caddyfile
Created January 29, 2020 10:09
用 Caddy 反代了一些网站
###################
# #
# SU.SG #
# #
###################
# https://mp.weixin.qq.com/s/H3OOqhFRr0YZGorIAlsCjA
# todo
# replace or remove content-security-policy header
@zrt
zrt / cat_camera.py
Created January 2, 2019 15:30
operating raspi camera
#! /usr/bin/env python3
import os
import time
PIC = False
CV2 = False
try:
from picamera import PiCamera
@zrt
zrt / run.py
Created June 9, 2018 02:21
run perception
#! /usr/bin/python3
from random import *
import os,sys
run = os.system
##BEGIN 这些需要修改
dataset = '20180103_nanian_103247'
target_dir = "/home/a/Desktop/PublicCourse/perception_project/Simple"
data_dir = "/home/a/Desktop/PublicCourse/perception_project/%s"%(dataset)
@zrt
zrt / cookie_to_js.py
Created May 24, 2017 11:28
raw cookie to js
@zrt
zrt / index.html
Created December 31, 2016 04:33 — forked from CaiJimmy/index.html
Disqus点击加载
<button id="load-disqus" onclick="disqus.load();">
加载Disqus
</button>
<div id="disqus_thread"></div>
@zrt
zrt / keybase.md
Last active March 23, 2019 03:40

Keybase proof

I hereby claim:

  • I am zrt on github.
  • I am zrt (https://keybase.io/zrt) on keybase.
  • I have a public key whose fingerprint is 8781 3E29 0648 42F3 87D9 BE68 63FB 4168 BCA6 5083

To claim this, I am signing this object:

import os
now=os.getcwd()
a=os.listdir()
a=list(filter(lambda x:os.path.isdir(x),a))
for s in a:
path=os.path.join(now,s)
os.chdir(path)
if os.path.isdir('.git'):
@zrt
zrt / bzoj2725_zrt
Created August 3, 2014 15:21
BZOJ 2725 : [Violet 6]故乡的梦
/**************************************************************
Problem: 2725
User: zrts
Language: C++
Result: Accepted
Time:13512 ms
Memory:49700 kb
****************************************************************/
#include<iostream>