Skip to content

Instantly share code, notes, and snippets.

@scottmac
scottmac / gist:1886965
Created February 22, 2012 20:14
If PHP Was English
Index: Zend/zend_language_scanner.l
===================================================================
--- Zend/zend_language_scanner.l (revision 322482)
+++ Zend/zend_language_scanner.l (working copy)
@@ -916,7 +916,7 @@
break;
}
case '\\':
- case '$':
+ case '£':
@scottmac
scottmac / gist:3703863
Created September 12, 2012 02:32
elasticsearch 0.19.9 in a cluster with 0.19.4
[2012-09-11 19:30:02,680][WARN ][http.netty ] [Brain Drain] Caught exception while handling client http traffic, closing connection [id: 0x7ce0c4a3, /10.42.149.65:55007 => /10.60.187.73:9200]
java.lang.NoSuchMethodError: org.elasticsearch.common.compress.lzf.ChunkEncoder.<init>(I)V
at org.elasticsearch.common.compress.lzf.LZFCompressedStreamOutput.<init>(LZFCompressedStreamOutput.java:42)
at org.elasticsearch.common.compress.lzf.LZFCompressor.streamOutput(LZFCompressor.java:133)
at org.elasticsearch.common.io.stream.CachedStreamOutput$Entry.handles(CachedStreamOutput.java:72)
at org.elasticsearch.transport.support.TransportStreams.buildRequest(TransportStreams.java:111)
at org.elasticsearch.transport.netty.NettyTransport.sendRequest(NettyTransport.java:502)
at org.elasticsearch.transport.TransportService.sendRequest(TransportService.java:185)
at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction.start(TransportShardReplicationOp
@scottmac
scottmac / gist:9013834
Created February 15, 2014 02:44
Fix gdft to load the preferred map rather than the last one in the font
diff --git a/ext/gd/libgd/gdft.c b/ext/gd/libgd/gdft.c
index aa8e8d3..d09ede5 100644
--- a/ext/gd/libgd/gdft.c
+++ b/ext/gd/libgd/gdft.c
@@ -126,6 +126,7 @@ typedef struct
typedef struct
{
char *fontlist; /* key */
+ int preferred_map;
FT_Library *library;
#!/usr/bin/env python
from urllib2 import urlopen
import xml.etree.ElementTree as ET
from collections import OrderedDict
alias_uri = 'http://www.unicode.org/repos/cldr/trunk/common/bcp47/timezone.xml'
alias_root = ET.parse(urlopen(alias_uri)).getroot()