Skip to content

Instantly share code, notes, and snippets.

View jurriaan's full-sized avatar
:octocat:
What's happening?

Jurriaan Pruis jurriaan

:octocat:
What's happening?
View GitHub Profile
#0 0x0000000100fc3b48 in ?? ()
#1 0x00007fff85555a9e in CFBasicHashFindBucket ()
#2 0x00007fff8555596b in CFDictionaryGetValue ()
#3 0x00007fff856343e2 in CFStringGetNameOfEncoding ()
#4 0x00007fff85fea858 in +[NSString(NSStringOtherEncodings) localizedNameOfStringEncoding:] ()
#5 0x000000010000ab81 in -[KDocument readFromData:ofType:error:callback:] (self=0x139e8b330, _cmd=0x100405aef, data=0x100dd1020, typeName=0x0, outError=0x7fff5fbfdc98, callback=0x7fff5fbfdc70) at KDocument.mm:1811
#6 0x000000010000b2cb in -[KDocument urlHandler:finishedReadingURL:data:ofType:error:callback:] (self=0x139e8b330, _cmd=0x100415b12, urlHandler=0x10212a570, url=0x13a1ca9a0, data=0x100dd1020, typeName=0x0, error=0x0, callback=0x7fff5fbfdd50) at KDocument.mm:1736
#7 0x000000010007e179 in __-[KHTTPURLHandler readURL:ofType:inTab:]_block_invoke_4 (.block_descriptor=0x13a1c7e50, err=0x0, data=0x100dd1020) at KHTTPURLHandler.mm:99
#8 0x000000010007fc35 in -[_HURLConnectionDelegate _onComplete:error:cancel:] (self=0x13a19e
@jurriaan
jurriaan / gist:763637
Created January 3, 2011 16:28
Random kod crash
(gdb) bt
#0 0x00007fff8838f15c in objc_msgSend_vtable2 ()
#1 0x00007fff855eb6ec in +[NSObject(NSObject) isAncestorOfObject:] ()
#2 0x00007fff85efb11c in -[NSConcretePortCoder encodeObject:isBycopy:isByref:] ()
#3 0x00007fff85f189fe in -[NSDictionary(NSDictionary) encodeWithCoder:] ()
#4 0x00007fff85efb3fe in -[NSConcretePortCoder encodeObject:isBycopy:isByref:] ()
#5 0x00007fff85efaacc in _NSWalkData2 ()
#6 0x00007fff85efbe42 in -[NSConcretePortCoder encodeInvocation:] ()
#7 0x00007fff85efb3fe in -[NSConcretePortCoder encodeObject:isBycopy:isByref:] ()
#8 0x00007fff85efaacc in _NSWalkData2 ()
@jurriaan
jurriaan / gist:763642
Created January 3, 2011 16:30
Random kod crash 2
2011-01-03 17:27:38.907 Kod[40716:a0f] T [src/KDocument.mm:381] -[KDocument setIconBasedOnContents]
2011-01-03 17:27:40.970 Kod[40716:a0f] D [src/CTBrowser.mm:405] [ChromiumTabs] TODO createHistoricalTab <KDocument@0x100debed0 'randomfilethatdoesntexists'>
closeDocument: 14597840 file://localhost/Users/jurriaanpruis/src/kod/randomfilethatdoesntexists
Program received signal: “EXC_BAD_ACCESS”.
sharedlibrary apply-load-rules all
(gdb) bt
#0 0x00007fff8838e120 in objc_msgSend ()
#1 0x00007fff855731e6 in _CFAutoreleasePoolPop ()
#2 0x00007fff85eb5100 in -[NSAutoreleasePool drain] ()
#3 0x00007fff8058f51f in -[NSApplication run] ()
class Test
constructor: ->
class Test2
constructor: ->
@test = new Test()
new Test2()
@jurriaan
jurriaan / gist:787857
Created January 20, 2011 13:20
Scope problems
test = {
'a': ->
console.log 1
'b': ->
console.log 2
}
test2 = {}
for title, func of test
console.log title
test2[title] = =>
@jurriaan
jurriaan / string.format.js
Created July 25, 2011 13:20 — forked from tbranyen/string.format.js
safer string formatting
// Inspired by http://bit.ly/juSAWl
// Augment String.prototype to allow for easier formatting. This implementation
// doesn't completely destroy any existing String.prototype.format functions,
// and will stringify objects/arrays.
String.prototype.format = function(i, safe, arg) {
function format() {
var str = this, len = arguments.length+1;
// For each {0} {1} {n...} replace with the argument in that position. If
Routes loaded, stack:
/usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/routing/mapper.rb:420:in `instance_exec'
/usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/routing/mapper.rb:420:in `block in with_default_scope'
/usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/routing/mapper.rb:618:in `scope'
/usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/routing/mapper.rb:419:in `with_default_scope'
/usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:287:in `eval_block'
/usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:295:in `block in finalize!'
/usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:295:in `each'
/usr/local/Cellar/ruby/2.0.0-p0/lib/r
require 'open-uri'
require 'rubocop'
require 'tmpdir'
url = 'https://raw.github.com/bbatsov/ruby-style-guide/master/README.md'
data = open(url).read
code_blocks = data.scan(/```ruby[\r\n]+(.*?)```/mi)
puts "Found #{code_blocks.length} code blocks"
@jurriaan
jurriaan / calculate_char_width.rb
Created April 3, 2014 10:31
A way to correctly determine the width of characters in Microsoft Excel
$widths = {1 => 68.28515625,
2 => 35,
3 => 112.7109375,
4 => 57.140625,
5 => 134.85546875,
6 => 68.28515625,
7 => 157,
8 => 79.42578125,
9 => 157,
10 => 79.42578125,
@jurriaan
jurriaan / icmake.rb
Created October 1, 2014 15:29
Icmake version 7.21.00
require 'formula'
class Icmake < Formula
url 'http://downloads.sourceforge.net/project/icmake/icmake/7.21.00/icmake_7.21.00.orig.tar.gz'
homepage 'http://icmake.sourceforge.net/'
sha1 '57e9a00963fbca1f9a3535b2b3cc5692f9799b5b'
depends_on 'gnu-sed'
def patches