Skip to content

Instantly share code, notes, and snippets.

View zwithz's full-sized avatar
:bowtie:
meow~

Zack Zhou zwithz

:bowtie:
meow~
View GitHub Profile
@zwithz
zwithz / check_my_followers_stats.js
Created August 22, 2020 00:38
A widget to visually show all my social media's followers stats by @scriptable. For more details -> https://twitter.com/zwithz1998/status/1296834411300716544
// Use @substats, a open source repo on @Github, to fetch all my social medias' stats
const url = "https://api.spencerwoo.com/substats/?source=weibo&queryKey=2028434647&source=twitter&queryKey=zwithz1998&source=jikeFollower&queryKey=e1377acb-40ed-495e-9a73-158273b4090a"
const req = new Request(url)
const json = await req.loadJSON()
const data = json.data.subsInEachSource
// Twitter
const twitterFollowers = data.twitter
@rometsch
rometsch / BH456A_linux_driver.md
Last active October 16, 2023 08:16
MPOW BH456A Bluetooth USB Adapter Kernel Module Adjustements (Realtek RTL8761B chip)

Problem

The MPOW Bluetooth 5 dongle (Model: BH456A) does not work out of the box on Ubuntu 20.04 (kernel 5.4.0-42).

Solution

Patch the bluetooth kernel module and copy the firmware binaries to /lib/firmware.

Copy the fimware

@Bern3rsH
Bern3rsH / roam-to-read.js
Last active June 21, 2020 06:57
自用 Roam Bookmarklet分享,新建一个书签,粘贴进去即可
javascript:(function(){
var title = document.getElementsByTagName("title")[0].innerHTML;
var url = window.location.href;
var selectText = '';
if (window.getSelection) {
selectText = window.getSelection().toString();
} else if (document.selection) {
selectText = document.selection.createRange().text;
}
var node = document.createElement('textarea');
@TheJLifeX
TheJLifeX / 00-hand-gesture-recognition.gif
Last active April 18, 2024 21:53
Simple Hand Gesture Recognition Code - Hand tracking - Mediapipe
00-hand-gesture-recognition.gif
@pangyuteng
pangyuteng / Dockerfile
Last active April 25, 2024 02:16
docker miniconda ubuntu
#
# ref https://github.com/tebeka/pythonwise/blob/master/docker-miniconda/Dockerfile
#
# miniconda vers: http://repo.continuum.io/miniconda
# sample variations:
# Miniconda3-latest-Linux-armv7l.sh
# Miniconda3-latest-Linux-x86_64.sh
# Miniconda3-py38_4.10.3-Linux-x86_64.sh
# Miniconda3-py37_4.10.3-Linux-x86_64.sh
#
@andywer
andywer / _readme.md
Last active March 7, 2024 05:52
React - Functional error boundaries

React - Functional error boundaries

Thanks to React hooks you have now happily turned all your classes into functional components.

Wait, all your components? Not quite. There is one thing that can still only be implemented using classes: Error boundaries.

There is just no functional equivalent for componentDidCatch and deriveStateFromError yet.

Proposed solution

@diegopacheco
diegopacheco / latest-protobuf-ubuntu-18-04.md
Created June 7, 2018 20:13
How to Install Latest Protobuf on Ubuntu 18.04
sudo apt-get install autoconf automake libtool curl make g++ unzip -y
git clone https://github.com/google/protobuf.git
cd protobuf
git submodule update --init --recursive
./autogen.sh
make
make check
sudo make install
sudo ldconfig
@nulledge
nulledge / H36M.ipynb
Last active September 8, 2021 03:39
Description for Human3.6M dataset.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@addyosmani
addyosmani / preprocessing.md
Last active May 4, 2024 23:04
JavaScript preprocessing/precompilation

Problem: How can we preprocess JavaScript (at build-time or on the server-side) so engines like V8 don't have to spend as much time in Parse? This is a topic that involves generating either bytecode or a bytecode-like-abstraction that an engine would need to accept. For folks that don't know, modern web apps typically spend a lot longer in Parsing & Compiling JS than you may think.

  • Yoav: This can particularly be an issue on mobile. Same files getting parsed all the time for users. Theoretically if we moved the parsing work to the server-side, we would have to worry about it less.
  • One angle to this problem is we all ship too much JavaScript. That's one perspective. We could also look at preprocessing.
  • We've been talking about this topic over the last few weeks a bit with V8. There were three main options proposed.
    1. Similar to what optimize-js does. Identify IIFEs and mark them as such so the browser and VMs heuristics will catch them and do a better job than today. optimize-js only tackles IIFE bu
@danieleggert
danieleggert / GPG and git on macOS.md
Last active May 3, 2024 12:26
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys