Skip to content

Instantly share code, notes, and snippets.

View liubenyuan's full-sized avatar
📺
ADI

liubenyuan liubenyuan

📺
ADI
View GitHub Profile
@cryzed
cryzed / fix-infinality.md
Last active March 20, 2025 13:16
A set of instructions on how to fix the harfbuzz + Infinality issue and restoring good-looking, Infinality-like font rendering.

Disclaimer: Please follow this guide being aware of the fact that I'm not an expert regarding the things outlined below, however I made my best attempt. A few people in IRC confirmed it worked for them and the results looked acceptable.

Attention: After following all the steps run gdk-pixbuf-query-loaders --update-cache as root, this prevents various gdk-related bugs that have been reported in the last few hours. Symptoms are varied, and for Cinnamon the DE fails to start entirely while for XFCE the icon theme seemingly can't be changed anymore etc.

Check the gist's comments for any further tips and instructions, especially if you are running into problems!

Screenshots

Results after following the guide as of 11.01.2017 13:08:

@cnlohr
cnlohr / i2s_stream.c
Last active September 24, 2024 21:56
ESP32 I2S C Code Example/Snippet
//Almost entirelly lifted directly from https://github.com/igrr/esp32-cam-demo
//Just clocked a little differently and has chained buffers.
//This totes works with the I2S bus on the ESP32 for READING 16 wires simultaneously.
//Can be clocked off of I2S's internal controller or an external clock.
#define I2S_D0 4
#define I2S_D1 5
#define I2S_D2 18
#define I2S_D3 19
#define I2S_D4 36
@liubenyuan
liubenyuan / weight-fun-oit.py
Created March 24, 2016 11:38
plot weighting function of oit
# plot weight of oit
import matplotlib.pyplot as plt
import numpy as np
N = 1000
z = np.linspace(1, 500, N)
def clamp(a, amin, amax):
@liubenyuan
liubenyuan / vispy-oit.py
Last active March 24, 2016 11:49
porting oit from the glumpy project to vispy
""" port oit, copied from glumpy """
import numpy as np
from vispy import app, gloo
from vispy.util.transforms import translate, perspective, rotate
vert_quads = """
uniform mat4 u_model;
uniform mat4 u_view;
uniform mat4 u_projection;
@pv
pv / colorized_voronoi.py
Last active March 10, 2025 01:15
Colorized Voronoi diagram with Scipy, in 2D, including infinite regions
import numpy as np
import matplotlib.pyplot as plt
from scipy.spatial import Voronoi
def voronoi_finite_polygons_2d(vor, radius=None):
"""
Reconstruct infinite voronoi regions in a 2D diagram to finite
regions.
Parameters
@endolith
endolith / sinc_interp.m
Created October 19, 2011 01:05
Perfect sinc interpolation in Matlab and Python
% From http://phaseportrait.blogspot.com/2008/06/sinc-interpolation-in-matlab.html
% Ideally "resamples" x vector from s to u by sinc interpolation
function y = sinc_interp(x,s,u)
% Interpolates x sampled sampled at "s" instants
% Output y is sampled at "u" instants ("u" for "upsampled")
% (EXPECTS x, s, and u to be ROW VECTORS!!)
% Find the period of the undersampled signal
T = s(2)-s(1);