Skip to content

Instantly share code, notes, and snippets.

View flymrc's full-sized avatar
🙈
On vacation

ruichao.ma flymrc

🙈
On vacation
View GitHub Profile
@flymrc
flymrc / ffmpeg_mkv_ops.md
Created August 31, 2023 09:48 — forked from cdeath/ffmpeg_mkv_ops.md
extract stuff from .mkv with ffmpeg
@flymrc
flymrc / cloudflare-worker-proxy.js
Created March 24, 2023 14:55 — forked from noobnooc/cloudflare-worker-proxy.js
cloudflare-worker-proxy
// Website you intended to retrieve for users.
const upstream = 'api.openai.com'
// Custom pathname for the upstream website.
const upstream_path = '/'
// Website you intended to retrieve for users using mobile devices.
const upstream_mobile = upstream
// Countries and regions where you wish to suspend your service.
@flymrc
flymrc / dante_setup.sh
Created November 9, 2021 09:39 — forked from gpchelkin/dante_setup.sh
How to Setup SOCKS5 Proxy Server for (not only) Telegram using Dante on Ubuntu 16.04 / 18.04 / 20.04
### NOT A SCRIPT, JUST A REFERENCE!
# install dante-server
sudo apt update
sudo apt install dante-server
# or download latest dante-server deb for Ubuntu, works for 16.04 / 18.04 / 20.04:
wget http://archive.ubuntu.com/ubuntu/pool/universe/d/dante/dante-server_1.4.2+dfsg-7build3_amd64.deb
# or older version:
wget http://ppa.launchpad.net/dajhorn/dante/ubuntu/pool/main/d/dante/dante-server_1.4.1-1_amd64.deb
@flymrc
flymrc / CORS TEST
Created October 28, 2021 07:25 — forked from Oranzh/CORS TEST
CORS 本地环境跨域测试方法
1.为什么要进行跨域测试?
因为一些(跨域)的请求会被同源策略禁止,比如Ajax请求
跨域资源共享(英语:Cross-origin resource sharing,缩写:CORS),用于让网页的受限资源能够被其他域名的页面访问的一种机制。
主要原因是我想测试Lumen的Cors中间件(https://github.com/palanik/lumen-cors)。
2.如何在本地环境进行测试?
谷歌浏览器(为什么是谷歌,因为我只用google浏览器)的开发者工具,打开console,输入以下JS代码
@flymrc
flymrc / id_rsa.pub
Created July 30, 2021 03:31
ruichaoma@ruichaoma-GE66-Raider-10SF
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDCCrz+f1uhAfo2HN6NPf7TuscgolKMZM3UK1G7zQvMjSASC6vRrgLdIWU/h3Wmg1OFJ3Xo/YW0l19Dw39T4caINRG+2JLY0u6QqyhBKrVjP5SNGUb6/+YgBQmuCg/bvaxvcjaFWWr26Bt2I7FnDnBn8yAgNtcbmCyIdGpysyIVhpMF4J6bBeVm5iQbe525buaHsvHrni5EIzCKUIeFAV30bAecHSQOu2VnFUuHiPDWk7PfPwkuZdlWgC13Nt8hl6a92nizm9UWhylJUGNwFcK8Mj9ul7fdM0QPjCPCFVimsrDVGo1l5DPE3g4l9HMK/PxQXHyPKpAI/3v2j2Hzar4ILen7z9DZ8zpQlvTLtsPEPwxAf7EP7UM8SkzbQKSyBd6+B8VgQM2XMn/DQ/YsbMfartZcYn+1y1hYSk6Ri1PJ3gNNvQ5876fp2MeyRq2dDojVRXn17giFH7JiTLrtFh9ABAg6UpZww/3HYkVUK+hmGU9Ll4E+cKcmleTxIeUIl4k= ruichaoma@ruichaoma-GE66-Raider-10SF
@flymrc
flymrc / aes-cbc-padding.kts
Last active October 30, 2023 13:24
Kotlin AES Encryption and Decryption
// ref: https://www.baeldung.com/java-aes-encryption-decryption
import java.util.*
import javax.crypto.Cipher
import javax.crypto.spec.IvParameterSpec
import javax.crypto.spec.SecretKeySpec
fun decrypt(algorithm: String, cipherText: String, key: SecretKeySpec, iv: IvParameterSpec): String {
val cipher = Cipher.getInstance(algorithm)
@flymrc
flymrc / vuetifyjs-login.html
Created March 26, 2021 08:14 — forked from devinhyden/vuetifyjs-login.html
Vuetifyjs Login Form
<!DOCTYPE html>
<html>
<head>
<link href='https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons' rel="stylesheet">
<link href="https://unpkg.com/vuetify/dist/vuetify.min.css" rel="stylesheet">
</head>
<style>
#app {
@flymrc
flymrc / lc_app.html
Created February 1, 2021 06:19
lc_app.html
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css"
@flymrc
flymrc / blaze_face_detect.py
Created July 16, 2020 07:41 — forked from ogl4jo3/blaze_face_detect.py
Demo BlazeFace model.
import cv2
import time
import math
import numpy as np
import tensorflow as tf
class SsdAnchorsCalculatorOptions:
def __init__(self, input_size_width, input_size_height, min_scale, max_scale
, num_layers, feature_map_width, feature_map_height
, strides, aspect_ratios, anchor_offset_x=0.5, anchor_offset_y=0.5
@flymrc
flymrc / new_app.py
Created May 22, 2020 11:17 — forked from ianschenck/new_app.py
Run your flask app under twisted wsgi, ALWAYS.
if __name__ == "__main__":
reactor_args = {}
def run_twisted_wsgi():
from twisted.internet import reactor
from twisted.web.server import Site
from twisted.web.wsgi import WSGIResource
resource = WSGIResource(reactor, reactor.getThreadPool(), app)
site = Site(resource)