Skip to content

Instantly share code, notes, and snippets.

@wez
wez / Post-Atomic.kbd.json
Last active December 13, 2016 08:55
Post-Atomic
[
{
"name": "Post-Atomic",
"author": "Wez Furlong"
},
[
{
"a": 5
},
"+\n=",
@wez
wez / Atomic.kbd.json
Last active December 13, 2016 05:46
Atomic
[
{
"backcolor": "#585858",
"name": "Atomic"
},
[
{
"a": 5
},
"~\n`",
@wez
wez / wez.itermcolors
Created March 2, 2011 01:11
Wez's iTerm 2 Colour selection
<?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 / fusion.diff
Created January 29, 2012 16:32
vmware fusion support for libvert
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 / theregister.diff
Created July 28, 2011 12:40
Page One: support for theregister
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 / treemap.diff
Created June 26, 2011 18:25
tweaks for qcachegrind
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 / build output
Created June 13, 2011 01:24
failure to build erlang on sparcv9 Solaris 10 with the system gcc
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 / msleep.c
Created May 24, 2011 02:39
How to sleep 0.5ms on Solaris
#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 / worker.js
Created October 20, 2009 02:54
playing with workers in titanium
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) {