Skip to content

Instantly share code, notes, and snippets.

View anthony-wang's full-sized avatar
💭
👨‍🔬🖥

Anthony Wang anthony-wang

💭
👨‍🔬🖥
View GitHub Profile
@anthony-wang
anthony-wang / syncscroll
Created April 1, 2021 05:31 — forked from shawwn/syncscroll
Synchronized scrolling (and zooming) across browser tabs
javascript:(function()%7Bwindow.addEventListener(%20'scroll'%2C%20(e)%20%3D%3E%20%7B%20localStorage.setItem('scrollY'%2C%20scrollY)%3B%20localStorage.setItem('zoom'%2C%20document.body.style.zoom)%3B%20%7D%20)%3Bwindow.addEventListener(%20'storage'%2C%20(e)%20%3D%3E%20%7B%20if%20(e.key%20%3D%3D%3D%20%22scrollY%22)%20%7B%20y%3DparseInt(e.newValue)%3B%20window.scrollTo(0%2C%20y)%3B%20%7D%3B%20if%20(e.key%20%3D%3D%3D%20%22zoom%22)%20%7B%20document.body.style.zoom%3De.newValue%3B%20%7D%3B%20%7D%20)%7D)()
@anthony-wang
anthony-wang / movie_color_bar.py
Created September 21, 2019 12:20 — forked from fanghuiz/movie_color_bar.py
Script to generate a color timeline based on video input (movie etc.) Modified from https://github.com/lint/avg-color-bar
from PIL import Image, ImageEnhance
import os
import subprocess
import sys
# Requires ffmpeg https://www.ffmpeg.org/ffmpeg.html
# Run script as
# python movie_color_bar.py input_video output_frame_folder output_image
@anthony-wang
anthony-wang / PEP8LineLengths.ipynb
Created June 7, 2019 04:26 — forked from jakevdp/PEP8LineLengths.ipynb
Further exploration of line lengths and PEP8
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Fine-tuning Ubuntu 16.04 on x240

Enabling middleclick scrolling in Ubuntu for Lenovo clickpads

With ubuntu 15.10, full clickpad support is provided by xserver-xorg-input-libinput. No further configuration needed. Tested with a T440s. (According to this)

Fine-tuning Ubuntu 14.04 on x240

@anthony-wang
anthony-wang / README.md
Created April 16, 2019 10:30 — forked from foosel/README.md
Getting the fingerprint reader of a Thinkpad x240 to work under Ubuntu 14.04

lsusb lists the fingerprint reader in the x240 as follows:

Bus 002 Device 003: ID 138a:0017 Validity Sensors, Inc.

There exists experimental driver support for this in a fork of libfprint for vfs5011 sensors, however you'll need to compile the driver yourself. To get the fingerprint sensor to work for lightdm login, su etc, follow these steps.

  1. Install fingerprint-gui:

    sudo add-apt-repository ppa:fingerprint/fingerprint-gui
    
@anthony-wang
anthony-wang / spotify-hosts.txt
Last active November 14, 2024 10:31
The hosts file entries to block Spotify ad servers
# Use this to block Spotify ad servers
# sources:
# https://www.reddit.com/r/Piracy/comments/4kn6rq/comprehensive_guide_to_blocking_ads_on_spotify/
# https://gist.github.com/teomaragakis/cb187d880c9a3ca2c8a2
# https://gist.github.com/Shujito/b7a8f8f971b22f49b4313d7d3e8e6931
# https://gist.github.com/rifkyekayama/f7c43e470f23878b20416e68f73829dc
# https://gist.github.com/shokoylele/8f4160a102480471cb946fbd800bc86a
############## Begin manual list
# 127.0.0.1 spclient.wg.spotify.com # might block the entire Spotify app from working too
@anthony-wang
anthony-wang / julia_type.md
Created May 19, 2018 07:31 — forked from tshort/julia_type.md
Convert a string to a Julia type
@anthony-wang
anthony-wang / julia_type.md
Created May 19, 2018 07:31 — forked from tshort/julia_type.md
Convert a string to a Julia type
using Documenter
using Documenter: Selectors, Expanders, Markdown
using Documenter.Markdown: Link, Paragraph
struct DatabaseLookup <: Expanders.ExpanderPipeline end
Selectors.order(::Type{DatabaseLookup}) = 0.5
Selectors.matcher(::Type{DatabaseLookup}, node, page, doc) = false
match_kw(x::String) = ismatch(r"\@library\[example\] \"(.*)\"", x)
match_kw(x::Paragraph) = any(match_kw, x.content)
custom_replacements = Dict{Regex, Function}(
r"@fetch_sample_from_database: \"(.*)\"" => function (match)::String
database_key = match.captures[1]
source = find_source(global_database, database_key)
# return a String with any markdown accepted by Documenter:
"""
```@example
$source
```
"""