Skip to content

Instantly share code, notes, and snippets.

View davidbalbert's full-sized avatar

David Albert davidbalbert

View GitHub Profile
@davidbalbert
davidbalbert / output
Created November 23, 2012 20:07
GDB 7.5 branch on OS X 10.8.2 load command errors
$ gdb/gdb /tmp/gdbtest/hello
GNU gdb (GDB) 7.5.0.20121123-cvs
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin12.2.0".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
@davidbalbert
davidbalbert / loadcommands.patch
Created December 3, 2012 19:58
GDB 7.5.1 OS X 10.8 Mach-O fixes
diff --git a/bfd/mach-o.c b/bfd/mach-o.c
index 29ebba4..e44cf6d 100644
--- a/bfd/mach-o.c
+++ b/bfd/mach-o.c
@@ -3666,6 +3666,48 @@ bfd_mach_o_read_encryption_info (bfd *abfd, bfd_mach_o_load_command *command)
return TRUE;
}
+static bfd_boolean
+bfd_mach_o_read_main (bfd *abfd, bfd_mach_o_load_command *command)
@davidbalbert
davidbalbert / COPYING
Last active December 10, 2015 02:08
A little Lisp
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
@davidbalbert
davidbalbert / put_this_in_your_repl.rb
Last active December 17, 2015 20:19
Ruby should have more multimedia!
>> load 'string_sayer.rb'
>> "Hello, world!"
=> "Hello, world!"
@davidbalbert
davidbalbert / pyqwt.sh
Last active June 22, 2019 19:59
PyQwt in a virtualenv
brew install qt # should already be done
brew install qwt # should already be done
brew install portaudio # should already be done
brew install wget # makes some downloading easier
# set up your virtualenv (`workon friture` if you've already created it)
mkvirtualenv friture
cd /tmp
@davidbalbert
davidbalbert / conditional_hash.rb
Last active December 21, 2015 02:38
Syntax idea: conditionals in hash literals
# If the conditionals evaluate to false, the key wouldn't be present in the hash
Person.new(
first_name: params[:first_name],
last_name: params[:last_name],
age: params[:age] if params[:age].to_i > 18,
bio: params[:bio] unless params[:bio].blank?)
# This would be equivalent to
@davidbalbert
davidbalbert / actual results (Homebrew go)
Last active December 24, 2015 02:39
Homebrew `go tool` and `go doc` bug
$ brew install go
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/go-1.1.2.mountain_lion.bottle.tar.gz
Already downloaded: /Library/Caches/Homebrew/go-1.1.2.mountain_lion.bottle.tar.gz
==> Pouring go-1.1.2.mountain_lion.bottle.tar.gz
==> Caveats
<snip>
==> Summary
/usr/local/Cellar/go/1.1.2: 3918 files, 110M
$ echo $GOROOT
/usr/local/Cellar/go/1.1.2
@davidbalbert
davidbalbert / gist:6815258
Last active April 27, 2025 02:06
How to install custom SSL certificates on an ASUS RT-N66U running asuswrt-merlin
###########################################
# IMPORTANT NOTE:
#
# As of asuswrt-merlin 380.67 Beta, you
# can now configure SSL certificates from
# the Webui, making these instructions
# unnecessary.
###########################################
@davidbalbert
davidbalbert / Gemfile
Created November 1, 2013 20:21
A silly little URL shortener.
source "https://rubygems.org"
gem "sinatra"
@davidbalbert
davidbalbert / cps-map.js
Created December 11, 2013 21:43
Three implementations of `map` in continuation passing style.
(function () {
"use strict";
var first = function (arr, c) {
c(arr[0]);
};
var rest = function (arr, c) {
c(arr.slice(1));
};