Skip to content

Instantly share code, notes, and snippets.

Wez Furlong wez

Block or report user

Report or block wez

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
@wez
wez / sslclient.php
Created Oct 17, 2009
poor mans ssl client that reads "asynchronously" (every 100ms)
View sslclient.php
class SSLSocket {
public $s = null;
public $on_err = null;
public $on_read = null;
public $on_readComplete = null;
public $on_timeout = null;
public $on_write = null;
public $endpoint = null;
public $wbuffer = array();
public $timer = null;
@wez
wez / worker.js
Created Oct 20, 2009
playing with workers in titanium
View worker.js
var fs = Titanium.Filesystem;
var api = Titanium.API;
api.print("worker starting\n");
var path = fs.getResourcesDirectory() + fs.getSeparator() + 'worker.php';
api.print("PHP code is at " + path + "\n");
if (false) {
@wez
wez / wez.itermcolors
Created Mar 2, 2011
Wez's iTerm 2 Colour selection
View wez.itermcolors
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.0</real>
<key>Green Component</key>
<real>0.0</real>
@wez
wez / msleep.c
Created May 24, 2011
How to sleep 0.5ms on Solaris
View msleep.c
#define _POSIX_PTHREAD_SEMANTICS
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <time.h>
#include <stdio.h>
static double compute_time_diff(struct timeval start, struct timeval end)
{
double diff = end.tv_sec - start.tv_sec;
@wez
wez / build output
Created Jun 13, 2011
failure to build erlang on sparcv9 Solaris 10 with the system gcc
View build output
cd lib && \
ERL_TOP=/var/tmp/pkgbuild-0/erlang/sparcv9/erlang-otp-73b4221 PATH=/var/tmp/pkgbuild-0/erlang/sparcv9/erlang-otp-73b4221/bootstrap/bin:${PATH} \
make opt SECONDARY_BOOTSTRAP=true
make[1]: Entering directory `/var/tmp/pkgbuild-0/erlang/sparcv9/erlang-otp-73b4221/lib'
make[2]: Entering directory `/var/tmp/pkgbuild-0/erlang/sparcv9/erlang-otp-73b4221/lib/hipe'
=== Entering application hipe
make[3]: Entering directory `/var/tmp/pkgbuild-0/erlang/sparcv9/erlang-otp-73b4221/lib/hipe/misc'
erlc -W +debug_info +warn_exported_vars +warn_missing_spec +warn_untyped_record -o../ebin hipe_consttab.erl
make[3]: *** [../ebin/hipe_consttab.beam] Bus Error (core dumped)
make[3]: Leaving directory `/var/tmp/pkgbuild-0/erlang/sparcv9/erlang-otp-73b4221/lib/hipe/misc'
@wez
wez / treemap.diff
Created Jun 26, 2011
tweaks for qcachegrind
View treemap.diff
Index: libviews/treemap.cpp
===================================================================
--- libviews/treemap.cpp (revision 1238414)
+++ libviews/treemap.cpp (working copy)
@@ -368,9 +368,12 @@
while(qAbs(maxWidth - usedWidth) > 3 * fm->maxWidth()) {
int halfPos = (bottomPos + breakPos)/2;
int halfWidth = fm->width(text, halfPos);
- if (halfWidth < maxWidth)
+ if (halfWidth < maxWidth) {
@wez
wez / theregister.diff
Created Jul 28, 2011
Page One: support for theregister
View theregister.diff
diff -ur pageone.orig/manifest.json pageone.wez/manifest.json
--- pageone.orig/manifest.json 2011-07-28 08:26:07.000000000 -0400
+++ pageone.wez/manifest.json 2011-07-28 08:38:08.000000000 -0400
@@ -1,7 +1,10 @@
{
"content_scripts": [ {
"js": [ "singlepage.js" ],
- "matches": [ "*://*.details.com/*", "*://*.newyorker.com/*", "*://*.theatlantic.com/*", "*://*.gourmet.com/*", "*://*.slate.com/*", "*://*.vanityfair.com/*", "*://*.wired.com/*", "*://*.nytimes.com/*", "*://*.observer.com/*", "*://*.thenation.com/*", "*://*.businessweek.com/*", "*://*.tnr.com/*", "*://*.rollingstone.com/*", "*://*.washingtonpost.com/*", "*://*.laphamsquarterly.org/*", "*://*.outsideonline.com/*", "*://*.gq.com/*", "*://*.moreintelligentlife.com/*", "*://*.foreignpolicy.com/*", "*://*.villagevoice.com/*", "*://*.cjr.org/*" ],
+ "matches": [ "*://*.details.com/*", "*://*.newyorker.com/*", "*://*.theatlantic.com/*", "*://*.gourmet.com/*", "*://*.slate.com/*", "*://*.vanityfair.com/*", "*://*.wired.com/*", "*://*.
@wez
wez / fusion.diff
Created Jan 29, 2012
vmware fusion support for libvert
View fusion.diff
diff -ur libvirt-0.9.9/src/vmware/vmware_conf.c /Users/wez/src/libvirt-0.9.9/src/vmware/vmware_conf.c
--- libvirt-0.9.9/src/vmware/vmware_conf.c 2011-11-03 10:48:23.000000000 -0400
+++ /Users/wez/src/libvirt-0.9.9/src/vmware/vmware_conf.c 2012-01-29 09:47:55.000000000 -0500
@@ -157,7 +157,7 @@
ctx.parseFileName = vmwareCopyVMXFileName;
cmd = virCommandNewArgList(VMRUN, "-T",
- driver->type == TYPE_PLAYER ? "player" : "ws",
+ vmw_types[driver->type],
"list", NULL);
@wez
wez / keybase.md
Created Mar 22, 2014
proving that I am me for keybase
View keybase.md

Keybase proof

I hereby claim:

  • I am wez on github.
  • I am wez (https://keybase.io/wez) on keybase.
  • I have a public key whose fingerprint is 3E25 F334 37AA 1A21 E51A DFED D1AD B15C 6195 09D9

To claim this, I am signing this object:

You can’t perform that action at this time.