Skip to content

Instantly share code, notes, and snippets.

/***************************************************************************
Copyright (c) Microsoft Corporation 2013.
This code is licensed using the Microsoft Public License (Ms-PL). You can find the text of the license here:
http://www.microsoft.com/resources/sharedsource/licensingbasics/publiclicense.mspx
Published at http://OpenXmlDeveloper.org
Resource Center and Documentation: http://openxmldeveloper.org/wiki/w/wiki/open-xml-sdk-for-javascript.aspx
@xndcn
xndcn / 0_reuse_code.js
Last active August 29, 2015 14:11
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
@xndcn
xndcn / d-term.py
Last active October 10, 2017 04:03
# coding=utf-8
import urwid
import requests
import re
from hashlib import md5
import time
from bs4 import BeautifulSoup, NavigableString
import lxml.html
/*
* Checksummed file writer
*
* This module collects data buffers until they should be written out to a
* file, prefixed by a checksum.
*
* Typical usage is:
*
* ChecksumWriter writer;
* cwriter_init(&writer);
@xndcn
xndcn / drawFont.py
Last active December 15, 2015 13:48
# coding=utf-8
import Image, ImageDraw, ImageFont
import struct
font_width = 16
font = ImageFont.truetype("/usr/share/fonts/truetype/wqy/wqy-zenhei.ttc", font_width)
def get_font_data(char):