Skip to content

Instantly share code, notes, and snippets.

View fujohnwang's full-sized avatar
🌓
儒释道法自然

王福强 fujohnwang

🌓
儒释道法自然
View GitHub Profile
@fujohnwang
fujohnwang / History|-1078599a|entries.json
Last active April 10, 2023 11:49
vscode setting sync
{"version":1,"resource":"file:///Users/fq/workspace.books/tek_commerce_and_humankind_2/src/chapters/different_life.md","entries":[{"id":"gNyV.md","timestamp":1657091957666},{"id":"9Wm8.md","timestamp":1657091994585},{"id":"rWrU.md","timestamp":1657092198062},{"id":"czaM.md","timestamp":1657092282114},{"id":"IcPm.md","timestamp":1657092305666},{"id":"kVky.md","timestamp":1657092322227},{"id":"N2Sj.md","timestamp":1657092376489},{"id":"ehOG.md","timestamp":1657092475226},{"id":"TEDx.md","timestamp":1657092485247},{"id":"crGG.md","timestamp":1657092518926},{"id":"V3mT.md","timestamp":1657092635402},{"id":"2AI5.md","timestamp":1657092667155},{"id":"J2eq.md","timestamp":1657092743759},{"id":"a36n.md","timestamp":1657092765447},{"id":"y3G7.md","timestamp":1657092832188},{"id":"Vlw4.md","timestamp":1657092872535},{"id":"VPuQ.md","timestamp":1657092935024},{"id":"wb4g.md","timestamp":1657092960999},{"id":"rkB7.md","timestamp":1657092987525},{"id":"x57R.md","source":"Workspace Edit","timestamp":1657092995836},{"id":"I
@fujohnwang
fujohnwang / gist:8997b43dc17462933e69e9bf86055ce9
Created June 22, 2021 01:49 — forked from BjornDCode/gist:5cb836a6b23638d6d02f5cb6ed59a04a
Tailwind - Fixed sidebar, scrollable content
// Source: https://twitter.com/calebporzio/status/1151876736931549185
<div class="flex">
<aside class="h-screen sticky top-0">
// Fixed Sidebar
</aside>
<main>
// Content
</main>
@fujohnwang
fujohnwang / Simple Play and Say.scpt
Created September 11, 2021 14:50 — forked from goldengrape/Simple Play and Say.scpt
Simple Play and Say.scpt
property defaultSlideDuraton : 2
property pauseBeforeSpeaking : 0 -- 1.5
property stoppingStatement : "[[slnc 1000]] Stopping presentation."
-- my startRecordScreen
tell application "QuickTime Player"
activate
set newScreenRecording to new screen recording
tell newScreenRecording
start
@fujohnwang
fujohnwang / cloudflare-worker-proxy.js
Created December 3, 2023 13:17 — forked from cnych/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.
@fujohnwang
fujohnwang / pagination_example.sql
Created February 28, 2024 04:43 — forked from ssokolow/pagination_example.sql
Reasonably efficient pagination without OFFSET (SQLite version)
-- Reasonably efficient pagination without OFFSET
-- SQLite version (Adapted from MS SQL syntax)
-- Source: http://www.phpbuilder.com/board/showpost.php?p=10376515&postcount=6
SELECT foo, bar, baz, quux FROM table
WHERE oid NOT IN ( SELECT oid FROM table
ORDER BY title ASC LIMIT 50 )
ORDER BY title ASC LIMIT 10
@fujohnwang
fujohnwang / index.js
Created May 25, 2024 01:37 — forked from n1ru4l/index.js
Fetch blob and convert to base64
export const fetchAsBlob = url => fetch(url)
.then(response => response.blob());
export const convertBlobToBase64 = blob => new Promise((resolve, reject) => {
const reader = new FileReader;
reader.onerror = reject;
reader.onload = () => {
resolve(reader.result);
};
reader.readAsDataURL(blob);