Skip to content

Instantly share code, notes, and snippets.

Ximing NdYAG

Block or report user

Report or block NdYAG

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
NdYAG / fontmin.js
Created Feb 28, 2019
webpack loader for font subset
View fontmin.js
const os = require('os')
const fs = require('fs')
const path = require('path')
const exec = require('child_process').exec
const fontsubset = function(source, text, callback) {
const tmp = path.join(os.tmpdir(), 'tmp.ttf')
const subset = `node_modules/fontsubset/bin/fontsubset -s ${text} ${source} ${tmp}`
const sfntedit = path.resolve(__dirname, '../assets/font/', 'sfntedit') + ' -d vhea ' + tmp
graph {
node [shape = rect, style = rounded]
subgraph cluster_moscow {
label = "Moscow"
NdYAG / .gitignore
Created Oct 22, 2015 — forked from octocat/.gitignore
Some common .gitignore configurations
View .gitignore
# Compiled source #
# Packages #
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# This script read the latest
# Beijing air quality from stateair
# and send notification to Pushbullet
import json
import urllib2
from xml.dom import minidom
View gist:a72ca9055d1f732b0dee

#Techniques for Anti-Aliasing @font-face on Windows

It all started with an email from a client: Do these fonts look funky to you? The title is prickly.

The font in question was Port Lligat Sans from Google Web Fonts.

The "prickly" is aliasing caused by lack of hinting

NdYAG / kobito.js
Created Jul 23, 2014 Exporter
View kobito.js
var util = require('util')
, sqlite3 = require('sqlite3').verbose()
, fs = require('fs')
, mkdirp = require('mkdirp')
var Kobito = function(path) {
this.db = new sqlite3.Database(path)
Kobito.prototype = {
execAll: function(sql, callback) {
NdYAG / 0_reuse_code.js
Created Jun 29, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View index.html
<!DOCTYPE html>
<link rel="stylesheet" type="text/css" href="style.css" />
<ul class="items">
<li class="item" data-status='{"liked": false}'>
<div class="item-status">
NdYAG / Book.markdown
Created Feb 20, 2014
A Pen by Simon.
View Book.markdown
You can’t perform that action at this time.