Skip to content

Instantly share code, notes, and snippets.

@NdYAG
NdYAG / kobito.js
Created July 23, 2014 04:19
Kobito.app Exporter
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) {

#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

#!/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
@NdYAG
NdYAG / .gitignore
Created October 22, 2015 09:38 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@NdYAG
NdYAG / the-master-and-margarita.dot
Created March 1, 2018 14:03
Character relationship
graph {
node [shape = rect, style = rounded]
subgraph cluster_moscow {
label = "Moscow"
Berlioz
Bezdomny
Styopa
Rimsky
Varenukha
Master
@NdYAG
NdYAG / fontmin.js
Created February 28, 2019 03:29
webpack loader for font subset
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