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 / mysql2sqlite.sh
Created January 16, 2019 08:09 — forked from esperlu/mysql2sqlite.sh
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@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)
@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 / 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 / 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 / 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 / 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 / ffmpeg_mkv_ops.md
Created August 31, 2023 09:48 — forked from cdeath/ffmpeg_mkv_ops.md
extract stuff from .mkv with ffmpeg