Skip to content

Instantly share code, notes, and snippets.

View zenwalk's full-sized avatar
🏠
Working from home

chenn zenwalk

🏠
Working from home
View GitHub Profile
@zenwalk
zenwalk / cfrw.py
Created April 26, 2023 08:33 — forked from sgillies/cfrw.py
Rasterio concurrency example
"""Concurrent read-process-write example"""
import concurrent.futures
from itertools import islice
from time import sleep
import rasterio
CHUNK = 100
@lewangdev
lewangdev / default.custom.yaml
Last active July 16, 2024 11:44
雾凇拼音自定义配置,MacOS-like & Wechat-like Dark/Light Color Scheme For Rime
patch:
# 菜单
menu:
page_size: 8 # 候选词个数
# alternative_select_labels: [ ①, ②, ③, ④, ⑤, ⑥, ⑦, ⑧, ⑨, ⑩ ] # 修改候选项标签
# alternative_select_keys: ASDFGHJKL # 如编码字符占用数字键,则需另设选字键
# ascii_mode、inline、no_inline、vim_mode 等等设定,可参考 /Library/Input Methods/Squirrel.app/Contents/SharedSupport/squirrel.yaml
# 中西文切换
#
# 【good_old_caps_lock】 CapsLock 切换到大写或切换中英。
@sgillies
sgillies / stats.py
Last active April 26, 2023 08:38
Simple and fancy ways of computing stats of a rasterio dataset
"""Three ways of computing stats of a rasterio dataset."""
import dask.array
import numpy
import rasterio
from rasterio.windows import Window
# Compute mean of entire dataset read into memory. Easiest, but doesn't
# scale for very large datasets.
with rasterio.open(
@chsbuffer
chsbuffer / MSServices.yaml
Last active January 21, 2024 12:57
Clash Premium proxy&rule provider example
# source: https://github.com/tindy2013/subconverter/blob/master/base/rules/MSServices.list
# Microsoft Services
# optimized from https://gist.github.com/TTTPOB/ce93fb3b04ba2f21880b09427442d831
# source: https://docs.microsoft.com/en-us/office365/enterprise/urls-and-ip-address-ranges
payload:
- DOMAIN-KEYWORD,1drv
- DOMAIN-KEYWORD,microsoft
- DOMAIN-SUFFIX,aadrm.com
- DOMAIN-SUFFIX,acompli.com
@amingholami
amingholami / make-chr.sh
Last active April 24, 2024 18:13 — forked from stroebs/make-chr.sh
Install Mikrotik CHR on a DigitalOcean Droplet (2021)
Install Mikrotik CHR on Digital Ocean Ubuntu 18.04 LTS Droplet. Tested 11/2021
1. Turn Off Droplet after creation and go to Recovery and set it to Boot from Recovery ISO.
2. Trun on Droplet and open Console
3. Press 6 and go to shell
4. Paste below code to install CHR on HDD
console.clear();
function saveData(blob, fileName)
{
var a = document.createElement("a");
document.body.appendChild(a);
a.style = "display: none";
var url = window.URL.createObjectURL(blob);
a.href = url;
const React = require('react')
const ReactDOMServer = require('react-dom/server')
const { createServer } = require('http')
const App = require('./build/static/js/main.49fed57c').default
createServer((req, res) => {
const el = React.createElement(App)
const html = ReactDOMServer.renderToString(el)
res.write(html)
res.end()
@aidik
aidik / command.md
Created July 6, 2019 19:08
curl ssh public key from GitHub to authorized_keys

mkdir -m 700 ~/.ssh; curl https://github.com/aidik.keys >> ~/.ssh/authorized_keys

@MaheKarim
MaheKarim / PluralSight Video Crack Code
Created May 20, 2019 15:58
PluralSight Video Crack Code
DecryptPluralSightVideos /F "C:\Users\Admin\AppData\Local\Pluralsight\courses" /DB "C:\Users\Admin\AppData\Local\Pluralsight\pluralsight.db" /TRANS /RM /OUT "L:\Course"
@jeff3dx
jeff3dx / d3-in-react.js
Last active October 27, 2022 09:24
D3 in React with Hooks
import React, { useRef, useEffect } from 'react';
import * as d3 from 'd3';
interface IProps {
data?: number[];
}
/* Component */
export const MyD3Component = (props: IProps) => {
/* The useRef Hook creates a variable that "holds on" to a value across rendering