Skip to content

Instantly share code, notes, and snippets.

View jasom's full-sized avatar

Jason Miller jasom

  • Santa Barbara, CA
View GitHub Profile
@jasom
jasom / hello.lisp
Last active December 29, 2015 17:47
Alternative way of launching lisp scripts on *nix
'eval' #|
exec sbcl --script "$0" "$@"
# |#
nil ;; this completes the quote from before the comment
(format t "Hello, ~A!~%" (or (second sb-ext:*posix-argv*) "world"))
@jasom
jasom / gist:68bb1d2b669e0b3d715a
Created September 24, 2015 03:47
valgrind output
@400000005603719a0f67b7cc ==9499== Invalid read of size 4 │········
@400000005603719a0f6a7ad4 ==9499== at 0x42FB9D: Handler_notify_leave (handler.c:76) │········
@400000005603719a0f6ba3b4 ==9499== by 0x45D9FF: Connection_handler_notify_leave (connection.c:110) │········
@400000005603719a0f6c91fc ==9499== by 0x45D9FF: Connection_task (connection.c:1138) │········
@400000005603719a0f6d9f84 ==9499== by 0x41DD3C: taskstart (task.c:37) │········
@400000005603719a0f6e8dcc ==9
@jasom
jasom / gist:b3cb5118e9e2efab3a5f
Created September 22, 2015 02:03
Proposed bstring fix
diff --git a/src/bstring.h b/src/bstring.h
index 70a9e4e..4f77726 100644
--- a/src/bstring.h
+++ b/src/bstring.h
@@ -37,5 +37,9 @@
#include <bstr/bstrlib.h>
#include <bstr/bstraux.h>
+#undef blength
+#undef bdata
pcm.ossmix {
type dmix
ipc_key 1024
ipc_key_add_uid false
ipc_perm 0666
slave {
pcm "front:CODEC"
period_time 0
period_size 1024
buffer_size 8192
@jasom
jasom / input.js
Created February 11, 2015 23:07
Bad output from JSX compiler?
foo = <form><Foo baz={(function (x) {
return x;
})} bar={1} /></form>
/bin/sh ./libtool --tag=CXX --mode=compile x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -DBUILDING_WebCore -DBUILDING_WEBKIT -Wall -W -Wcast-align -Wchar-subscripts -Wreturn-type -Wformat -Wformat-security -Wno-format-y2k -Wundef -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings -Wno-unused-parameter -Wno-parentheses -fno-exceptions -DBUILDING_CAIRO__ -DBUILDING_GTK__ -I./Source/ThirdParty/ANGLE/src -I./Source/ThirdParty/ANGLE/include -I./Source/ThirdParty/ANGLE/include/GLSLANG -I./Source/ThirdParty/ANGLE/include/KHR -I./DerivedSources/Platform -DWEBKITGTK_API_VERSION_STRING=\"1.0\" -DDATA_DIR=\"/usr/share\" -I./Source/ThirdParty/ANGLE/src -I./Source/ThirdParty/ANGLE/include -I./Source/ThirdParty/ANGLE/include/GLSLANG -I./Source/ThirdParty/ANGLE/include/KHR -I./Source/WebCore -I./Source/WebCore/Modules/battery -I./Source/WebCore/Modules/gamepad -I./Source/WebCore/Modules/geolocation -I./Source/WebCore/Modules/indexeddb -I./Source/WebCore/Modules/indexeddb/leveldb -I./Source/WebCore/Modules/indi
@jasom
jasom / a.clasp.instructions.md
Last active August 29, 2015 14:07
How to install clasp on gentoo

You will need gcc:4.8 installed; as of writing this is keyword masked, so unless you are already running ~, you'll need to add sys-devel/gcc:4.8 ~amd64 to your package.keywords. Note that you do not need it to be the default gcc, as clasp allows specifying gcc and g++ executables

Other than that, see the other files in this gist for the config.

  1. Checkout clasp-externals and clasp
  2. Copy clasp-externals.local.config from this gist to clasp-externals/local.config
  3. Copy clasp.local.config from this gist to clasp/local.config
  4. cd clasp-externals
  5. make
  6. If make fails, run it again. If it fails a third time, talk to jasom in #clasp on freenode
@jasom
jasom / gist:2aea37660f8c56ca86c4
Created September 17, 2014 18:25
stack trace of crash
09-17 11:24:03.989 E/GeckoAppShell(24102): >>> REPORTING UNCAUGHT EXCEPTION FROM THREAD 1 ("main")
09-17 11:24:03.989 E/GeckoAppShell(24102): java.lang.NullPointerException
09-17 11:24:03.989 E/GeckoAppShell(24102): at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:440)
09-17 11:24:03.989 E/GeckoAppShell(24102): at com.android.internal.policy.impl.PhoneWindow.openPanel(PhoneWindow.java:553)
09-17 11:24:03.989 E/GeckoAppShell(24102): at com.android.internal.policy.impl.PhoneWindow.openPanel(PhoneWindow.java:513)
09-17 11:24:03.989 E/GeckoAppShell(24102): at android.app.Activity.openOptionsMenu(Activity.java:2800)
09-17 11:24:03.989 E/GeckoAppShell(24102): at org.mozilla.gecko.BrowserApp.openOptionsMenu(BrowserApp.java:2254)
09-17 11:24:03.989 E/GeckoAppShell(24102): at org.mozilla.gecko.GeckoApp.onKeyDown(GeckoApp.java:491)
09-17 11:24:03.989 E/GeckoAppShell(24102): at org.mozilla.gecko.BrowserApp.onKeyDown(BrowserApp.java:359)
09-17 11:24:03.989 E/GeckoAppShell(24102): at a
@jasom
jasom / foo.rs
Created September 15, 2014 21:23
struct ExternalNode {
key: int,
value: int
}
fn main() {
let mut boxed_node = box ExternalNode{ key : 1, value: 2};
match boxed_node {
@jasom
jasom / fccgparse.lisp
Created September 2, 2014 19:48
Example of parsing a pdf
;;;; fccgparse.lisp
(in-package #:fccgparse)
;;; "fccgparse" goes here. Hacks and glory await!
;(declaim (optimize (debug 3)))
;(declaim (notinline make-instance))
(defun my-capitalize (string)