Skip to content

Instantly share code, notes, and snippets.

View jokester's full-sized avatar
🌛
not my photo / still alive and with a cat now!!! (as of 2024-03)

Wang Guan jokester

🌛
not my photo / still alive and with a cat now!!! (as of 2024-03)
View GitHub Profile
@jokester
jokester / ABOUT_ME.md
Last active March 24, 2024 17:07
about me

My GitHub stats

I love crafting new stuff and make things happen.

My interested fields includes:

  • Web / GUI / Graphics
  • ML / DL
@jokester
jokester / hash_accessor.js
Created February 22, 2016 05:42
Save and load JSON value with URL hash (aka URL fragment)
/**
* Save and load JSON value with URL hash (aka URL fragment)
*
* hash_accessor.load() -> load
* hash_accessor.save(obj) -> save serialized obj into hash
*/
var hash_accessor = (function (window) {
return {
load: function () {
@jokester
jokester / slides.md
Last active March 18, 2024 08:39
thecoo-python-data-seminar-02

theme: simple


DataFrame

Takeaway: they are spreadsheets


Deploy k3s cluster on Vultr with RancherOS over ZeroTier network

How to deploy K3S cluster on RancherOS nodes connected via a Zerotier network.

Deploy master node

1. Update the master-deploy.sh with deployment vars

01.道可道,非常道。名可名,非常名。无名天地之始。有名万物之母。故常无欲以观其妙。常有欲以观其徼。此两者同出而异名,同谓之玄。玄之又玄,众妙之门。

02.天下皆知美之为美,斯恶矣;皆知善之为善,斯不善已。故有无相生,难易相成,长短相形,高下相倾,音声相和,前後相随。是以圣人处无为之事,行不言之教。万物作焉而不辞。生而不有,为而不恃,功成而弗居。夫唯弗居,是以不去。

03.不尚贤, 使民不争。不贵难得之货,使民不为盗。不见可欲,使民心不乱。是以圣人之治,虚其心,实其腹,弱其志,强其骨;常使民无知、无欲,使夫智者不敢为也。为无为,则无不治。

04.道冲而用之,或不盈。渊兮似万物之宗。解其纷,和其光,同其尘,湛兮似或存。吾不知谁之子,象帝之先。

05.天地不仁,以万物为刍狗。圣人不仁,以百姓为刍狗。天地之间,其犹橐迭乎?虚而不屈,动而愈出。多言数穷,不如守中。

// ==UserScript==
//
// @id www.amazon.com-b556bb6f-ee56-4bea-b588-998dc5bb4777@scriptish
//
// @namespace http://userscript.org/~hitsmaxft
//
// @name Kindle Library Powerpack
//
// @version 2.6.1
//
@jokester
jokester / PixelExtractor.swift
Last active January 4, 2022 07:27
extract pixel from a CGImage
// extract pixel from a CGImage
/* use case:
let extractor = PixelExtractor(img: UIImage(named: "gauge_vertical")!.CGImage!)
let color = extractor.color_at(x: 10, y: 20)
*/
class PixelExtractor {
// taken from http://stackoverflow.com/questions/24049313/
// and adapted to swift 1.2
@jokester
jokester / README.md
Last active November 24, 2020 09:32
customized btrfs image for raspberry pi 4b
@jokester
jokester / some-workflow-snippet.yaml
Last active November 22, 2020 16:07
Tricks for github action workflows
# poc of string interpolation in bash / github action
- name: print env variables to job output
run: for v in `cat env` ; do echo "::set-env name=${v%%=*}::${v##*=}" ; done
- name: use (maybe ) in shell command
run: docker push myrepo/myapp:${TAG_REF#refs/tags/}
env:
TAG_REF: ${{ github.ref }}
@jokester
jokester / converter_base.rb
Created March 1, 2020 10:56
my beancount importers
module Converter
class BaseConverter
def initialize input_file, **options
@input_file = input_file
@options = options
end
def write output_file, force: false
if output_file.exist? && !force
puts " NOT overwriting #{output_file}. remove dest file and rerun or specify 'force' flag"