Skip to content

Instantly share code, notes, and snippets.

View NZKoz's full-sized avatar

Michael Koziarski NZKoz

View GitHub Profile
@NZKoz
NZKoz / preg.rb
Created January 18, 2012 02:45 — forked from avibryant/preg.rb
require 'date'
DUE_DATE = "2012-02-15"
#data taken from http://spacefem.com/pregnant/charts/duedate2.php
#starts at day 222
DATA = [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 2, 1, 4, 2, 2, 1, 4, 6, 7, 5, 1, 5, 8, 7, 9, 10, 11, 13, 13, 18,
14, 13, 9, 27, 29, 27, 31, 27, 26, 36, 43, 43, 51, 67, 74, 60, 47,
@NZKoz
NZKoz / janus.log
Created January 3, 2012 04:44
Broken Janus Install
Koz-Prostyle:~ michaelkoziarski$ curl -Lo- http://bit.ly/janus-bootstrap | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 950 100 950 0 0 478 0 0:00:01 0:00:01 --:--:-- 3104
Cloning into /Users/michaelkoziarski/.vim...
remote: Counting objects: 2687, done.
remote: Compressing objects: 100% (1168/1168), done.
remote: Total 2687 (delta 1525), reused 2498 (delta 1365)
Receiving objects: 100% (2687/2687), 321.94 KiB | 91 KiB/s, done.
Resolving deltas: 100% (1525/1525), done.
@NZKoz
NZKoz / Error Message.markdown
Created September 25, 2011 21:03
moxy error

Safari

Safari

Chrome

Chrome

@NZKoz
NZKoz / weirdApi.m
Created August 16, 2011 22:49
Core Data API Weirdness
// constructor returns object which is useless till you do some other stuff
NSManagedObjectContext *context = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType];
// The context is 'initialized' but completely useless till this next line executes.
context.persistentStoreCoordinator = coordinator;
// returned object is immediately useful and API nicely encapsulated
NSManagedObjectContext *context = [coordinator newManagedObjectContextWithConcurrencyType:NSPrivateQueueConcurrencyType];
@NZKoz
NZKoz / gist:1131038
Created August 8, 2011 01:23
MR Market
Ben Graham, my friend and teacher, long ago described the
mental attitude toward market fluctuations that I believe to be
most conducive to investment success. He said that you should
imagine market quotations as coming from a remarkably
accommodating fellow named Mr. Market who is your partner in a
private business. Without fail, Mr. Market appears daily and
names a price at which he will either buy your interest or sell
you his.
Even though the business that the two of you own may have
@NZKoz
NZKoz / kiji-fail.log
Created August 4, 2011 01:22
Kiji fail
Koz-Prostyle:TheRugbySite michaelkoziarski$ ./script/rails server
/Users/michaelkoziarski/OpenSource/rails/activesupport/lib/active_support/dependencies.rb:100: [BUG] gc_sweep(): unknown data type 0x3a(0x104d4d4d8)
ruby 1.8.7 (2010-04-19 patchlevel 253) [i686-darwin11.0.0], MBARI 0x6770, Ruby Enterprise Edition 2010.02, Kiji 0.11
Abort trap: 6
Koz-Prostyle:TheRugbySite michaelkoziarski$ ./script/rails console
NOTE: Gem.searcher is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.searcher called from /Users/michaelkoziarski/.rvm/gems/kiji-head/bundler/gems/query_reviewer-9de60e75d180/lib/query_reviewer.rb:25.
NOTE: Gem::GemPathSearcher#initialize is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem::GemPathSearcher#initialize called from /Users/michaelkoziarski/.rvm/rubies/kiji-head/lib/ruby/site_ruby/1.8/rubygems.rb:939.
@NZKoz
NZKoz / AWESOME.diff
Created August 4, 2011 01:20
Kiji Fixes
diff --git a/actionpack/lib/abstract_controller/view_paths.rb b/actionpack/lib/abstract_controller/view_paths.rb
index 6544c89..c9e194d 100644
--- a/actionpack/lib/abstract_controller/view_paths.rb
+++ b/actionpack/lib/abstract_controller/view_paths.rb
@@ -5,7 +5,7 @@ module AbstractController
included do
class_attribute :_view_paths
self._view_paths = ActionView::PathSet.new
- self._view_paths.freeze
+ # self._view_paths.freeze
@NZKoz
NZKoz / make.log
Created August 4, 2011 00:43
kiji build
[2011-08-04 12:41:52] make
gcc -g -O2 -pipe -fno-common -DRUBY_EXPORT -I. -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -c array.c
WARNING: While resolving call to function 'inspect_ary' arguments were dropped!
gcc -g -O2 -pipe -fno-common -DRUBY_EXPORT -I. -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -c bignum.c
gcc -g -O2 -pipe -fno-common -DRUBY_EXPORT -I. -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -c class.c
gcc -g -O2 -pipe -fno-common -DRUBY_EXPORT -I. -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -c compar.c
gcc -g -O2 -pipe -fno-common -DRUBY_EXPORT -I. -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -c dir.c
gcc -g -O2 -pipe -fno-common -DRUBY_EXPORT -I. -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -c dln.c
gcc -g -O2 -pipe -fno-common -DRUBY_EXPORT -I. -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -c enum.c
gcc -g -O2 -pipe -fno-common -DRUBY_EXPORT -I. -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -c enumerator.c
@NZKoz
NZKoz / first-try-install.log
Created June 3, 2011 02:54
Seriously messed up
Koz-Prostyle:elf michaelkoziarski$ bundle
Fetching git://github.com/mislav/will_paginate.git
remote: Counting objects: 2838, done.
remote: Compressing objects: 100% (1027/1027), done.
remote: Total 2838 (delta 1839), reused 2711 (delta 1756)
Receiving objects: 100% (2838/2838), 394.82 KiB | 216 KiB/s, done.
Resolving deltas: 100% (1839/1839), done.
Fetching git://github.com/sandal/prawn.git
remote: Counting objects: 16217, done.
remote: Compressing objects: 100% (5520/5520), done.
@NZKoz
NZKoz / total_hax.rb
Created May 29, 2011 22:58
Hax to get around a factory girl issue
#EGGREGIOUS HAX
class Factory::Proxy::Build
def associate(name, factory, attributes)
if factory.to_s =~ /member/i
set(name, Factory.build(factory, attributes))
else
set(name, Factory.create(factory, attributes))
end
end
end