Skip to content

Instantly share code, notes, and snippets.

View halfbyte's full-sized avatar
🌍
Doing stuff

Jan Krutisch halfbyte

🌍
Doing stuff
View GitHub Profile
@halfbyte
halfbyte / Error messages #2
Created July 31, 2011 18:21
Error messages
RestKitObjectMapping
/Users/jankrutisch/cocoa/RestKitTest/RestKit/Code/ObjectMapping/RKObjectPolymorphicMapping.m
/Users/jankrutisch/cocoa/RestKitTest/RestKit/Code/ObjectMapping/RKObjectPolymorphicMapping.m:69: error: no declaration of property 'delegateBlock' found in the interface
/Users/jankrutisch/cocoa/RestKitTest/RestKit/Code/ObjectMapping/RKObjectPolymorphicMapping.m:108:171: error: macro "NSAssert" passed 3 arguments, but takes just 2
/Users/jankrutisch/cocoa/RestKitTest/RestKit/Code/ObjectMapping/RKObjectPolymorphicMapping.m:108: error: 'NSAssert' undeclared (first use in this function)
/Users/jankrutisch/cocoa/RestKitTest/RestKit/Code/ObjectMapping/RKObjectPolymorphicMapping.m:130: error: request for member 'delegateBlock' in something not a structure or union
@halfbyte
halfbyte / gist:1117039
Created July 31, 2011 18:21
Error messages
RestKitObjectMapping
/Users/jankrutisch/cocoa/RestKitTest/RestKit/Code/ObjectMapping/RKObjectPolymorphicMapping.m
/Users/jankrutisch/cocoa/RestKitTest/RestKit/Code/ObjectMapping/RKObjectPolymorphicMapping.m:69: error: no declaration of property 'delegateBlock' found in the interface
/Users/jankrutisch/cocoa/RestKitTest/RestKit/Code/ObjectMapping/RKObjectPolymorphicMapping.m:108:171: error: macro "NSAssert" passed 3 arguments, but takes just 2
/Users/jankrutisch/cocoa/RestKitTest/RestKit/Code/ObjectMapping/RKObjectPolymorphicMapping.m:108: error: 'NSAssert' undeclared (first use in this function)
/Users/jankrutisch/cocoa/RestKitTest/RestKit/Code/ObjectMapping/RKObjectPolymorphicMapping.m:130: error: request for member 'delegateBlock' in something not a structure or union
@halfbyte
halfbyte / questions.rb
Created May 3, 2011 13:19 — forked from tow8ie/answers.rb
Rack Nested Params Parsing Quiz My Solution
"x[y][z]=1" # => {"x" => {"y" => {"z" => "1"}}}
"x[y][z][]=1" # => {"x" => {"z" => ["1"]}
"x[y][z]=1&x[y][z]=2" # => {"x" => {"z" => ["1", "2"]}
"x[y][z][]=1&x[y][z][]=2" # => {"x" => {"y" => {"z" => ["1", "2"]}}
"x[y][][z]=1" # => {"x" => {"y" => [{"z" => "1"}]}}
@halfbyte
halfbyte / js1k.html
Created April 11, 2011 22:07
my contribution to js1k#3
<!doctype html>
<html>
<head>
<title>JS1k, 1k demo submission [ID]</title>
<meta charset="utf-8" />
</head>
<body>
<canvas id="c"></canvas>
<script>
namespace :compass do
desc "Validate the sass files"
task :check do
require 'tmpdir'
FileUtils.rm_rf "public/stylesheets/compiled"
FileUtils.rm_rf "app/stylesheets/.sass-cache"
err_filename = File.join(Dir.tmpdir, 'compass_err.txt')
system "compass >/dev/null 2>#{err_filename}"
if (File.exist?(err_filename))
err = File.read(err_filename)
require 'autotest/fsevent'
require 'autotest/growl'
require 'redgreen/autotest'
# sudo gem install portmidi term_ansicolor
require 'launchpad/device'
require 'term/ansicolor'
# MySpace libs
%w( connection object
album detail friends friendship
interest mood photo profile status user video
).each(&method(:require))
# Base libraries
%w( pp net/http cgi ).each(&method(:require))
#define SHIFT_DATA 8
#define SHIFT_CLK 9
#define SHIFT_OUT 10
#define LED 13
#define PATTERN 0x5555
unsigned int image[] = {
0x55AA,
0xAA55,
0x55AA,
@halfbyte
halfbyte / hudson.rake
Created January 12, 2009 11:12
tasks for ci on hudson for rails apps
begin
gem 'ci_reporter'
rescue
$: << File.dirname(__FILE__) + "/../lib"
end
require 'ci/reporter/rake/rspec'
require 'ci/reporter/rake/test_unit'
module HudsonCompatibility
def mock_uploader(file, type = 'image/png')
filename = "%s/%s" % [ File.dirname(__FILE__), file ]
uploader = ActionController::UploadedStringIO.new
uploader.original_path = filename
uploader.content_type = type
def uploader.read
File.read(original_path)
end
def uploader.size
File.stat(original_path).size