Skip to content

Instantly share code, notes, and snippets.

Jiang Jiang jjgod

Block or report user

Report or block jjgod

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
jjgod / gmail.css
Created Feb 16, 2014
GMail Style Tweaks
View gmail.css
div.editable {
font-family: monospace;
font-size: 100%;
div.Bk, .G-atb, .ha, .zE {
-webkit-font-smoothing: subpixel-antialiased !important;
background-color: #fff;
#!/usr/bin/env python
import os
import subprocess
import sys
# A minimal memoizing decorator. It'll blow up if the args aren't immutable,
# among other "problems".
class memoize(object):
def __init__(self, func):
jjgod / cldr-tool.patch
Created Mar 14, 2014
Patch to CLDR Java tool from
View cldr-tool.patch
Index: org/unicode/cldr/icu/
--- org/unicode/cldr/icu/ (revision 9961)
+++ org/unicode/cldr/icu/ (working copy)
@@ -84,7 +84,8 @@
.add("filter", 'f', null, null, "Perform filtering on the locale data to be converted.")
.add("organization", 'o', ".*", null, "The organization to filter the data for")
.add("makefile", 'g', ".*", null, "If set, generates makefiles and alias files for the specified type. " +
- "The value to set should be the name of the makefile.");
+ "The value to set should be the name of the makefile.")
jjgod / osx-video-decoding-efficiency.markdown
Last active Aug 29, 2015
CPU consumption numbers for current video players on OS X
View osx-video-decoding-efficiency.markdown
/* Example code of using harfbuzz together with Core Text APIs. */
#include <hb-coretext.h>
int main(int argc, char* argv[]) {
if (argc != 3) {
fprintf(stderr, "usage: %s <PostScript-Name> <text>\n", argv[0]);
return 1;
View gist:5f6f5d7cee26030d87d4
ASSERTION FAILED: !object->isSetNeedsLayoutForbidden()
../../third_party/WebKit/Source/core/rendering/RenderObject.cpp(671) : void WebCore::RenderObject::markContainingBlocksForLayout(bool, WebCore::RenderObject *, WebCore::SubtreeLayoutScope *)
1 0xd081c2d WebCore::RenderObject::markContainingBlocksForLayout(bool, WebCore::RenderObject*, WebCore::SubtreeLayoutScope*)
2 0xd15849a WebCore::RenderObject::setNeedsLayout(WebCore::MarkingBehavior, WebCore::SubtreeLayoutScope*)
3 0xcfed7c5 WebCore::RenderImage::repaintOrMarkForLayout(bool, WebCore::IntRect const*)
4 0xcfed4a0 WebCore::RenderImage::imageChanged(void*, WebCore::IntRect const*)
5 0xd093e8c WebCore::RenderObject::imageChanged(WebCore::ImageResource*, WebCore::IntRect const*)
6 0xc95a4db WebCore::ImageResource::notifyObservers(WebCore::IntRect const*)
7 0xc95b0ff WebCore::ImageResource::animationAdvanced(WebCore::Image const*)
8 0xc95b15f non-virtual thunk to WebCore::ImageResource::animationAdvanced(WebCore::Image const*)
View gist:bbf9d3bfc6a2a1f5110a
In file included from /Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/OpenGL.framework/Headers/OpenGL.h:10:
/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/OpenGL.framework/Headers/gl.h:2765:13: error: conflicting types for 'GLES2TexImage2D'
extern void glTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
../../gpu/GLES2/gl2chromium_autogen.h:124:22: note: expanded from macro 'glTexImage2D'
#define glTexImage2D GLES2_GET_FUN(TexImage2D)
../../gpu/GLES2/gl2chromium.h:22:29: note: expanded from macro 'GLES2_GET_FUN'
#define GLES2_GET_FUN(name) GLES2 ## name
jjgod / LionOrLater.cpp
Created May 19, 2014
Test whether a system is running 10.7 or later
View LionOrLater.cpp
#define MAC_OS_X_VERSION_10_7_HEX 0x00001070
static int sOnLionOrLater = -1;
static bool OnLionOrLater()
if (sOnLionOrLater < 0) {
SInt32 major = 0, minor = 0;
CFURLRef url =
jjgod / KeychainTest.c
Last active Aug 29, 2015
Build with `clang -framework CoreFoundation -Wall -framework Security KeychainTest.c -o kctest`
View KeychainTest.c
#include <sys/param.h>
#include <Security/Security.h>
static void displayName(const void *value, void *context)
SecKeychainRef keychain = (SecKeychainRef) value;
UInt32 pathLength = MAXPATHLEN;
char pathName[MAXPATHLEN + 1];
SecKeychainGetPath(keychain, &pathLength, pathName);
printf(" \"%*s\"\n", (int)pathLength, pathName);
jjgod / fallback.m
Last active Aug 29, 2015
Test Core Text fallback line height.
View fallback.m
// Compile with: clang fallback.m -framework CoreGraphics -framework CoreText -framework Foundation -o fallback
// Run with: ./fallback "Fallback Font Family" "Text to Typeset"
#import <ApplicationServices/ApplicationServices.h>
#import <Foundation/Foundation.h>
int main(int argc, char *argv[])
if (argc != 3)
return 0;
You can’t perform that action at this time.