Skip to content

Instantly share code, notes, and snippets.

require 'rubygems'
require 'couchrest'
class Doc < CouchRest::ExtendedDocument
property :normal_property
property :casted_model, :cast_as => 'CastedModel'
end
class CastedModel < Hash
include CouchRest::CastedModel
# from casted_model_spec.rb
class WithCastedModelMixin < Hash
include CouchRest::CastedModel
property :name
property :no_value
property :details, :default => {}
property :casted_attribute, :cast_as => 'WithCastedModelMixin'
end
class DummyModel < CouchRest::ExtendedDocument
@wasnotrice
wasnotrice / gist:1158573
Created August 20, 2011 03:01
Homebrew pango error
brew install pango
==> Downloading http://ftp.gnome.org/pub/GNOME/sources/pango/1.28/pango-1.28.4.t
File already downloaded in /Users/eric/Library/Caches/Homebrew
==> ./configure --prefix=/usr/local/Cellar/pango/1.28.4 --with-x
==> make install
Making install in pango
GEN s-enum-types-h
GEN s-enum-types-c
make install-recursive
Making install in opentype
@wasnotrice
wasnotrice / gist:1169921
Created August 25, 2011 03:30
Shoes Console errors (though the build runs)
8/24/11 10:25:15.118 PM [0x0-0x14b14b].org.hackety.shoes: (process:39999): Pango-WARNING **: couldn't load font "Lacuna Not-Rotated 17.3330078125px", falling back to "Sans Not-Rotated 17.3330078125px", expect ugly output.
8/24/11 10:25:15.147 PM [0x0-0x14b14b].org.hackety.shoes: (process:39999): Pango-WARNING **: couldn't load font "Lacuna Not-Rotated 64px", falling back to "Sans Not-Rotated 64px", expect ugly output.
diff --git a/shoes/native/cocoa.m b/shoes/native/cocoa.m
index 91f2ef7..4155461 100644
--- a/shoes/native/cocoa.m
+++ b/shoes/native/cocoa.m
@@ -116,7 +116,7 @@
Data_Get_Struct(app, shoes_app, a);
Data_Get_Struct(a->canvas, shoes_canvas, canvas);
if (type == s_motion)
- shoes_app_motion(a, p.x, (canvas->height - p.y) + canvas->slot->scrolly);
+ shoes_app_motion(a, (int)round(p.x), (canvas->height - (int)round(p.y)) + canvas->slot->scrolly);
Shoes.app do
para `cd ../rails/tl-html5/; rvm use 1.9.2; ruby -v`
end
@wasnotrice
wasnotrice / gist:1200779
Created September 7, 2011 14:53
shoes_textcursor
//
// text cursor
//
typedef struct {
int pos, x, y, hi;
} shoes_textcursor;
//
// text block struct
//
@wasnotrice
wasnotrice / gist:1202571
Created September 8, 2011 03:57
warnings progress
101,102d100
< In file included from shoes/app.c:6:
< ./shoes/app.h:66: warning: function declaration isn’t a prototype
110d107
< shoes/app.c:275: warning: function declaration isn’t a prototype
198,199d194
< In file included from shoes/canvas.c:6:
< ./shoes/app.h:66: warning: function declaration isn’t a prototype
295,296d289
< In file included from shoes/effects.c:6:
@wasnotrice
wasnotrice / gist:1214020
Created September 13, 2011 14:59
Crash when launching shoes-bin directly
Process: shoes-bin [527]
Path: /Users/USER/Downloads/*/Shoes-1.app/Contents/MacOS/shoes-bin
Identifier: org.hackety.shoes
Version: 0.r1696 (???)
Build Info: Shoes-1200000~1
Code Type: X86-64 (Native)
Parent Process: bash [18869]
Date/Time: 2011-09-13 09:53:56.672 -0500
OS Version: Mac OS X 10.7.1 (11B26)
@wasnotrice
wasnotrice / gist:1222396
Created September 16, 2011 15:41
That's a lot of log messages!
9/16/11 2:05:14.378 AM [0x0-0x743743].org.hackety.shoes: PLACE: (0, 0), (401: 365, 36: 0) [0, 0] 2
9/16/11 2:05:14.378 AM [0x0-0x743743].org.hackety.shoes: REFLOW: 18, 18 (18, 18) / 0, 0 / 401, 36 (0, 0)
9/16/11 2:05:14.378 AM [0x0-0x743743].org.hackety.shoes: TEXT: 18, 18 (401, 36) / (18: 18, 18: 18) 93, 18 [0]
9/16/11 2:05:14.378 AM [0x0-0x743743].org.hackety.shoes: CX: (18, 36) / LRECT: (0, 92) / END: (18, 36)
9/16/11 2:05:14.378 AM [0x0-0x743743].org.hackety.shoes: TEXT: 18, 36 (401, 36) / (18: 22, 36: 36) 233, 77 [0]
9/16/11 2:05:14.378 AM [0x0-0x743743].org.hackety.shoes: CX: (18, 113) / LRECT: (0, 225) / END: (18, 113)
9/16/11 2:05:14.378 AM [0x0-0x743743].org.hackety.shoes: *** process 62153 exceeded 500 log message per second limit - remaining messages this second discarded ***