Skip to content

Instantly share code, notes, and snippets.

View xiamaz's full-sized avatar
🚩
Semaphoring

Max Xiaohang Zhao xiamaz

🚩
Semaphoring
View GitHub Profile
@stephenturner
stephenturner / mendeley-scihub.json
Created July 25, 2018 09:57
Sci-Hub look up engine for Zotero. Add to zotero engines file (https://www.zotero.org/support/locate#managing_lookup_engines). Afterwards, relaunch Zotero, make sure the newly added lookup engine is checked under Locate (green arrow) -> Manage Lookup Engines.
[
{
"name": "Sci-Hub Lookup",
"alias": "Sci-Hub",
"icon": "null",
"_urlTemplate": "https://sci-hub.tw/{z:DOI}",
"description": "Sci-Hub full text PDF search",
"hidden": false,
"_urlParams": [],
"_urlNamespaces": {
@cryzed
cryzed / fix-infinality.md
Last active August 31, 2024 13:05
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:

@zackthehuman
zackthehuman / cycle.frag
Created November 11, 2012 10:02
Color/palette cycling using GLSL (example in SFML)
uniform sampler2D texture;
uniform sampler2D colorTable;
uniform float paletteIndex;
void main()
{
vec2 pos = gl_TexCoord[0].xy;
vec4 color = texture2D(texture, pos);
vec2 index = vec2(color.r + paletteIndex, 0);
vec4 indexedColor = texture2D(colorTable, index);