Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
👨‍🔬🖥

Anthony Wang anthony-wang

💭
👨‍🔬🖥
View GitHub Profile
@anthony-wang
anthony-wang / syncscroll
Created Apr 1, 2021 — forked from shawwn/syncscroll
Synchronized scrolling (and zooming) across browser tabs
View syncscroll
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 Sep 21, 2019 — 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
View movie_color_bar.py
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 Jun 7, 2019 — forked from jakevdp/PEP8LineLengths.ipynb
Further exploration of line lengths and PEP8
View PEP8LineLengths.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View fine-tuning-ubuntu-on-x240.md

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 Apr 16, 2019 — forked from foosel/README.md
Getting the fingerprint reader of a Thinkpad x240 to work under Ubuntu 14.04
View README.md

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 Jul 13, 2018
The hosts file entries to block Spotify ad servers
View spotify-hosts.txt
# 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 — forked from tshort/julia_type.md
Convert a string to a Julia type
View julia_type.md
@anthony-wang
anthony-wang / julia_type.md
Created May 19, 2018 — forked from tshort/julia_type.md
Convert a string to a Julia type
View julia_type.md
View custom-replacements2.jl
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)
View custom-replacements.jl
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
```
"""