Skip to content

Instantly share code, notes, and snippets.

View pingf's full-sized avatar
💭
waiting for delivery!

Makefile君 pingf

💭
waiting for delivery!
View GitHub Profile
@pingf
pingf / lit-element-in-browser.html
Created February 9, 2023 22:19 — forked from mcmoe/lit-element-in-browser.html
Using Lit Element without npm directly in the browser
<!-- From: https://gist.githubusercontent.com/sorvell/48f4b7be35c8748e8f6db5c66d36ee29/raw/67346e4e8bc4c81d5a7968d18f0a6a8bc00d792e/index.html -->
<!doctype html>
<html>
<head>
<!-- Polyfills only needed for Firefox and Edge. -->
<script src="https://unpkg.com/@webcomponents/webcomponentsjs@latest/webcomponents-loader.js"></script>
</head>
<body>
<!-- Works only on browsers that support Javascript modules like
Chrome, Safari, Firefox 60, Edge 17 -->
@pingf
pingf / rate_limit.py
Created July 21, 2022 02:13 — forked from KhanhhNe/rate_limit.py
Python thread-safe throttling (rate limiting)
import asyncio
import threading
import time
from collections import deque
from datetime import datetime
from functools import wraps
from inspect import iscoroutinefunction
from typing import cast
@pingf
pingf / echarts-svg.js
Created March 15, 2021 00:27 — forked from pissang/echarts-svg.js
Server side SVG rendering of ECharts
const echarts = require("echarts");
const Canvas = require('canvas');
const {JSDOM} = require('jsdom');
const fs = require('fs');
echarts.setCanvasCreator(() => {
return new Canvas(100, 100);
});
const {window} = new JSDOM();
global.window = window;
@pingf
pingf / app.py
Created February 18, 2021 08:32 — forked from dmontagu/app.py
FastAPI + dash
# Based on the example from https://www.activestate.com/blog/dash-vs-bokeh/
import dash
import dash_core_components as dcc
import dash_html_components as html
import pandas as pd
import plotly.graph_objs as obj
import uvicorn as uvicorn
from dash.dependencies import Input, Output
from fastapi import FastAPI
from starlette.middleware.wsgi import WSGIMiddleware
import os
import signal
import subprocess
import sys
# Parse command-line arguments.
if len(sys.argv) > 1:
folder = os.path.abspath(sys.argv[1])
else:
folder = os.path.abspath(os.getcwd())
@pingf
pingf / open-source-sso.md
Created April 28, 2020 07:58 — forked from thomasdarimont/open-source-sso.md
Comparison of open-source SSO implementations
@pingf
pingf / WebGL-frameworks-libraries.md
Created April 27, 2020 06:50 — forked from dmnsgn/WebGL-WebGPU-frameworks-libraries.md
A collection of WebGL frameworks and libraries

A non-exhaustive list of WebGL frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are outdated/not maintained anymore.

Engines and libraries

  • three.js: JavaScript 3D library
  • stack.gl: an open software ecosystem for WebGL, built on top of browserify and npm.
  • PixiJS: Super fast HTML 5 2D rendering engine that uses webGL with canvas fallback
  • Pex: Pex is a javascript 3d library / engine allowing for seamless development between Plask and WebGL in the browser.
  • Babylon.js: a complete JavaScript framework for building 3D games with HTML 5 and WebGL
  • Filament: Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS and WASM/WebGL
  • ClayGL: A WebGL graphic library helping you to
@pingf
pingf / ipvlan_l3_mode_example.md
Created July 30, 2019 10:54 — forked from nerdalert/ipvlan_l3_mode_example.md
IPVlan L3 Mode Two Host Example

Quick Paste Ipvlan L3 Instructions

  • Host #1
ip netns add ns1
ip link add link eth1 ipvl1 type ipvlan mode l3
ip link set dev ipvl1 netns ns1

ip netns exec ns1 bash
@pingf
pingf / simpletun.c
Created July 29, 2019 11:16 — forked from rickyzhang-cn/simpletun.c
一个简单的使用tun/tap建立tunnel的示例代码
/**************************************************************************
* simpletun.c *
* *
* A simplistic, simple-minded, naive tunnelling program using tun/tap *
* interfaces and TCP. Handles (badly) IPv4 for tun, ARP and IPv4 for *
* tap. DO NOT USE THIS PROGRAM FOR SERIOUS PURPOSES. *
* *
* You have been warned. *
* *
* (C) 2009 Davide Brini. *