Skip to content

Instantly share code, notes, and snippets.

View jiachengpan's full-sized avatar
🐳
摸鱼

Jiacheng Pan jiachengpan

🐳
摸鱼
View GitHub Profile
@jiachengpan
jiachengpan / svg-pan-zoom.min.js
Created November 15, 2021 03:36
svg-pan-zoom
// svg-pan-zoom v3.6.1
// https://github.com/ariutta/svg-pan-zoom
!function s(r,a,l){function u(e,t){if(!a[e]){if(!r[e]){var o="function"==typeof require&&require;if(!t&&o)return o(e,!0);if(h)return h(e,!0);var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}var i=a[e]={exports:{}};r[e][0].call(i.exports,function(t){return u(r[e][1][t]||t)},i,i.exports,s,r,a,l)}return a[e].exports}for(var h="function"==typeof require&&require,t=0;t<l.length;t++)u(l[t]);return u}({1:[function(t,e,o){var s=t("./svg-utilities");e.exports={enable:function(t){var e=t.svg.querySelector("defs");if(e||(e=document.createElementNS(s.svgNS,"defs"),t.svg.appendChild(e)),!e.querySelector("style#svg-pan-zoom-controls-styles")){var o=document.createElementNS(s.svgNS,"style");o.setAttribute("id","svg-pan-zoom-controls-styles"),o.setAttribute("type","text/css"),o.textContent=".svg-pan-zoom-control { cursor: pointer; fill: black; fill-opacity: 0.333; } .svg-pan-zoom-control:hover { fill-opacity: 0.8; } .svg-pan-zoom
@jiachengpan
jiachengpan / clock_wns_tns.py
Created August 18, 2021 11:44
clock_wns_tns
import pandas as pd
import random
import string
import numpy as np
clocks = 'abcd'
data = [{
'path': ''.join(random.choices(string.ascii_uppercase + string.digits, k=8)),
'slack': random.random() * 10 - 5,
@jiachengpan
jiachengpan / .vimrc
Last active February 8, 2019 06:42
add gutentags docs
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
wget https://freevps.us/downloads/bench.sh -O - -o /dev/null|bash
// ==UserScript==
// @name Youtube Screenshooter
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @require https://code.jquery.com/jquery-latest.js
// @require https://gist.githubusercontent.com/BrockA/2625891/raw/9c97aa67ff9c5d56be34a55ad6c18a314e5eb548/waitForKeyElements.js
// @require https://raw.githubusercontent.com/ilkkao/capture-video-frame/master/capture-video-frame.js
// @include *://*.youtube.com/embed/*
[Unit]
Description=NGROK
After=network.target
[Service]
Type=simple
ExecStart=/opt/bin/ngrok tcp --region ap --log /dev/shm/ngrok.log --config /home/ngrok/.ngrok2/ngrok.yml 22
Restart=always
[Install]
@jiachengpan
jiachengpan / crest
Created June 6, 2017 15:09
crest upstart script
start on filesystem and started networking
respawn
chdir /opt/crest
setuid www-data
exec /usr/bin/nodejs bin/crest
@jiachengpan
jiachengpan / 0_reuse_code.js
Created April 30, 2017 04:34
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jiachengpan
jiachengpan / collect_captcha.js
Last active August 19, 2017 06:53
tampermonkey script to collect taobao miaosha captcha
// ==UserScript==
// @name Taobao Miaosha Captcha Collector
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match http*://*.item.taobao.com/*
// @require https://code.jquery.com/jquery-latest.js
// @grant none
// ==/UserScript==
@jiachengpan
jiachengpan / main.cu
Last active October 22, 2023 15:39
timing sorting SoA and AoS using thrust::sort / thrust::sort_by_key
#include <thrust/device_vector.h>
#include <thrust/sort.h>
#include <string>
using namespace std;
const unsigned int TEST_SIZE = 10000000;
struct UserInt3 {
int x;