Skip to content

Instantly share code, notes, and snippets.

@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
@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 / .gitignore
Created October 22, 2015 09:38 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# 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

#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
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) {
@NdYAG
NdYAG / 0_reuse_code.js
Created June 29, 2014 15:24
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<ul class="items">
<li class="item" data-status='{"liked": false}'>
<div class="item-status">
@NdYAG
NdYAG / Book.markdown
Created February 20, 2014 16:34
A Pen by Simon.