Skip to content

Instantly share code, notes, and snippets.

View andy0130tw's full-sized avatar
🍌
why no 🍆

Andy Pan andy0130tw

🍌
why no 🍆
View GitHub Profile
@jjgod
jjgod / 0001-Fix-CID-keyed-fonts-glyph-lookup.patch
Last active March 3, 2019 11:25
Patch to dvipdfm-x for CID-keyed font support
From 759df18a9c8ec05c6830687682c57d9e4c6a55d3 Mon Sep 17 00:00:00 2001
From: Jiang Jiang <gzjjgod@gmail.com>
Date: Sat, 26 Jul 2014 21:33:19 +0200
Subject: [PATCH 1/3] Fix CID-keyed fonts glyph lookup
Keep cff_charsets parsed from CID font around if exists. Use the
cff_charsets to do GID -> CID lookup.
---
texk/dvipdfm-x/cff.c | 14 ++++++++------
texk/dvipdfm-x/cff.h | 1 +
@pburtchaell
pburtchaell / styles.css
Last active February 25, 2024 12:24
VH and VW units can cause issues on iOS devices. To overcome this, create media queries that target the width, height, and orientation of iOS devices.
/**
* VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units
*
* To overcome this, create media queries that target the width, height, and orientation of iOS devices.
* It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing
* the height of element `.foo` —which is a full width and height cover image.
*
* iOS Resolution Quick Reference: http://www.iosres.com/
*/
@skeeto
skeeto / Makefile
Created October 21, 2014 03:51
C Object Oriented Programming Example
CFLAGS = -std=c99 -Wall
main : main.o
.PHONY : test clean
test : main
./$^ "*regex*" "*vtable*" < main.c
clean :
@karpathy
karpathy / min-char-rnn.py
Last active June 2, 2024 20:38
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@jankais3r
jankais3r / Ghost_custom_excerpt_tag.md
Created July 29, 2015 21:49
Ghost - custom excerpt tag

This code snippet implements manual control over excerpts in Ghost.

You will need to modify 2 files and 1 setting:

  1. Ghost/core/server/helpers/content.js - this one will get overwritten during Ghost update
  2. Ghost/content/themes//partials/loop.hbs - this one has to be modified for each theme
  3. 'Blog Footer' section of 'Code Injection' settings page

Default behavior is having whole articles displayed on the front page. If you want to display only an excerpt, put `` at the position you want to cut the article.

<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//
@paulirish
paulirish / what-forces-layout.md
Last active May 31, 2024 22:37
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@Francesco149
Francesco149 / shige-skins.md
Last active March 31, 2024 14:53
Shigetora / Cookiezi skin compilation
@vancluever
vancluever / gnome-tracker-disable.md
Last active May 2, 2024 16:26
GNOME Tracker Disable

Disabling GNOME Tracker and Other Info

GNOME's tracker is a CPU and privacy hog. There's a pretty good case as to why it's neither useful nor necessary here: http://lduros.net/posts/tracker-sucks-thanks-tracker/

After discovering it chowing 2 cores, I decided to go about disabling it.

Directories

/**=======佈景發佈 by疾患=======**/
/*作者噗浪 http://www.plurk.com/hoshikata*/
/*
請直接在自訂佈景把所有的語法貼上,而且必須先選擇新版的預設佈景,
背景圖片當然自己放即可。
此佈景適合搭配的背景是偏灰色單調背景。
*/
/**隱藏廣告**/
#resp_banner_ads.show {height: 0px; overflow: hidden;}