Skip to content

Instantly share code, notes, and snippets.

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

王福强 fujohnwang

🌓
儒释道法自然
View GitHub Profile
@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 / 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 / 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 / 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 / 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
type D=Double;def w(x:D,y:D,a:D)={val(i,j)=(x-a,y-8);Math.sqrt(i*i+j*j)< 8};val l:Stream[Char]="love".toStream#:::l;val c=l.toIterator;def p(b:Boolean)=print(if(b)c.next else' ');for(y<-0 to 24){for(x<-0 to 32){if(y>7)p((16-x).abs< 24-y)else p(w(x,y,8)|w(x,y,24))};println}
@fujohnwang
fujohnwang / 2020-04-02T10:21:06
Last active April 2, 2020 02:39
microblog of mine, since weibo or twitter is out of control ;0)
哪有什么岁月静好,无非是有人替你寻衅滋事罢了,比如老罗与暖气片的故事
@fujohnwang
fujohnwang / run-ansible-with-any-host-without-inventory
Created December 17, 2019 03:23 — forked from lilongen/run-ansible-with-any-host-without-inventory
How to run Ansible without specifying the inventory but the host directly?
Question:
. How to run Ansible without specifying the inventory but the host directly?
. Run a playbook or command with arbitrary host not in the inventory hosts list?
. run ansible with arbitrary host/ip without inventory?
Answer:
Surprisingly, the trick is to append a ,
The host parameter preceding the , can be either a hostname or an IPv4/v6 address.
ansible all -i example.com,
@fujohnwang
fujohnwang / gist:4acd9183350767d06438
Created October 22, 2014 07:38
lombok maven config
<properties>
<compiler.version>1.6</compiler.version>
<java_source_version>1.6</java_source_version>
<java_target_version>1.6</java_target_version>
<file_encoding>UTF-8</file_encoding>
</properties>
<build>
<finalName>test</finalName>
<plugins>