Skip to content

Instantly share code, notes, and snippets.

View yxy's full-sized avatar

BBB yxy

  • gggg
View GitHub Profile
@yxy
yxy / SimpleCaptcha.py
Created October 9, 2015 04:10
A simple captcha generator using PIL
#-*- encoding: utf8 -*-
from PIL import Image, ImageDraw, ImageFont
import random
import string
class SimpleCaptchaException(Exception):
pass
@yxy
yxy / hstruct.py
Created April 28, 2015 14:30
This recipe provides a higher level wrapper around the struct module.
# encoding: utf-8
"""
This recipe provides a higher level wrapper around the struct module.
It provides a more convenient syntax for defining and using structs,
and adds additional features such as:
- Allows embedding structures within other structures
- Allows defining arrays of items (or other structures)
- Class based syntax, allowing access and updates by field name, not position
@yxy
yxy / 0_reuse_code.js
Last active August 29, 2015 14:18
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