Skip to content

Instantly share code, notes, and snippets.


Ewen Cheslack-Postava ewencp

View GitHub Profile
View gist:6387c4947bf196dbbf2d
✘-1 ~/confluent/blueway.git [norwood-if-you-build-it|✔]
14:17 $ mvn clean package
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building blueway 2.1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ blueway ---

Keybase proof

I hereby claim:

  • I am ewencp on github.
  • I am ewencp ( on keybase.
  • I have a public key whose fingerprint is 713E 6517 0A2D 1AB7 30AE FDD9 DDAA 3452 5234 D94F

To claim this, I am signing this object:

ewencp / pyhashxx-build-all-wheels.bat
Created Oct 25, 2014
Helper script to build and upload pyhashxx wheels on Windows
View pyhashxx-build-all-wheels.bat
:: Required: git, Visual Studio 10.0 Express, Visual Studio 9 Express,
:: Windows 7 SDK (.NET 4), Windows 7 SDK (.NET 3.5), Anaconda/Miniconda
:: User configurable stuff start ::
:: These depends on where you installed Anaconda.
:: Python2 or Python3 doesn't matter but you need both 32bit and 64bit versions.
set ANACONDA_BASE=C:\Users\Administrator\Anaconda
ewencp / gist:ef7343d21aa84b84526b
Created Oct 21, 2014
View gist:ef7343d21aa84b84526b
diff --git a/src/main/java/org/xerial/snappy/buffer/ b/src/main/java/org/xerial/snappy/buffer/
index 2ad9926..eacc50b 100644
--- a/src/main/java/org/xerial/snappy/buffer/
+++ b/src/main/java/org/xerial/snappy/buffer/
@@ -29,10 +29,16 @@ public class CachedBufferAllocator implements BufferAllocator {
public static synchronized CachedBufferAllocator getAllocator(int bufferSize) {
- if(!queueTable.containsKey(bufferSize)) {
- queueTable.put(bufferSize, new SoftReference<CachedBufferAllocator>(new CachedBufferAllocator(bufferSize)));
ewencp /
Created Oct 16, 2013
Simple example of reduce-side join in mrjob
from mrjob.job import MRJob
class JoinExample(MRJob):
def mapper(self, id, record):
# Use both large files as input. If you have orders and
# customers, you'll have as input either
# order_id, order_data
# or
# customer_id, customer_data
# In this case, I assume both have a customerID field to join
ewencp / html_email_preview.js
Last active May 13, 2019
Quick Javascript hack to preview HTML emails, extracting the HTML portion from a raw email message and stripping it similarly to email clients to preview how it will likely look to the recipient.
View html_email_preview.js
(function() {
/* First try to handle pages which are actually raw text of the email.
Extract the HTML part and replace page with it */
var orig_html = document.getElementsByTagName('html')[0].textContent;
var extracted_html = orig_html;
/* Try splitting it up if it's actually the multipart email. Otherwise, work
on the document itself, leaving the orig_html in place */
var boundary_pattern = '--===============';
while (extracted_html.indexOf(boundary_pattern) != -1) {
var next_boundary = extracted_html.indexOf(boundary_pattern);
ewencp /
Created Jun 26, 2013
SQL to MongoDB Mapping Chart
  1. Switch back to SQL.
ewencp / trans.html
Created Nov 20, 2012
Test page with no background specified so it is transparent
View trans.html
ewencp /
Created Aug 15, 2012
Quick, simple implementation of Error Level Analysis
#!/usr/bin/env python
# This is a really simple implementation of ELA as described in
# You shouldn't actually use it, or at least read the paper carefully
# and implement more of the techniques before drawing any conclusions.
from PIL import Image, ImageChops, ImageEnhance
import sys, os.path
View gist:2234226
sudo apt-get install \
git-core cmake sed unzip zip automake1.9 nvidia-cg-toolkit jam g++ \
libzzip-dev libxt-dev libxaw7-dev libxxf86vm-dev libxrandr-dev libfreetype6-dev \
libxext-dev autoconf libtool libpcre3-dev flex bison patch libbz2-dev gawk \
libglu1-mesa-dev tofrodos freeglut3-dev scons libexpat1-dev \
libgtk2.0-dev libnss3-dev libgconf2-dev gperf libasound2-dev subversion \
libtool autoconf ruby flex libgsl0-dev libssl-dev libspeex-dev libxss-dev \
libdbus-glib-1-dev libgnome-keyring-dev libxml2-dev libjpeg62-dev libcups2-dev \