Skip to content

Instantly share code, notes, and snippets.

/// DO CHANGE
///
self = [super init];
if (self == nil) {
return nil;
}
///
self = [super init];
if (self == nil) return nil;
Ну условно говоря:
Модеь: АААА! Давление 1960 на 1230!!!
Viewmodel : состояние лампочки: красное
View; Окей, отобразим ! красным
# и в обратную сторону
(Пользователь жмет педальку)
View : -> ViewModel
Слушай, тут пользователь жмякнул педальку.
#!/usr/bin/env bash
declare -i ERRORS=0
if git rev-parse --verify HEAD > /dev/null 2>&1
then
AGAINST=HEAD
else
AGAINST=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi
@stanislaw
stanislaw / gist:d12c750b7cfc20dc399e
Created August 31, 2014 15:21
RestKit Core Data concurrency problems (fix NOT applied)
2014-08-31 19:19:34.170 SportUp[1152:607] I restkit.network:RKObjectRequestOperation.m:150 GET 'https://d3scr0eofaakvi.cloudfront.net/uploads/teams/194/original/public.png?1405607852'
2014-08-31 19:19:34.172 SportUp[1152:607] I restkit.network:RKObjectRequestOperation.m:186 GET 'https://d3scr0eofaakvi.cloudfront.net/uploads/teams/194/original/public.png?1405607852' (200 OK) [0.0013 s]
2014-08-31 19:19:42.677 SportUp[1152:5003] Invalid concurrent access to managed object calling 'release'; Stacktrace: (
0 SportUp 0x002a300b ValidateConcurrency + 267
1 SportUp 0x002a2c04 CustomSubclassRelease + 36
2 CoreFoundation 0x033ffbf0 CFRelease + 272
3 CoreFoundation 0x03432b82 -[__NSArrayI dealloc] + 82
4 libobjc.A.dylib 0x02ce6692 _ZN11objc_object17sidetable_releaseEb + 268
5 libobjc.A.dylib 0x02ce7aeb -[NSObject release] + 25
6 libobjc.A.dylib
@stanislaw
stanislaw / gist:a82b3573704f2336fb41
Created August 31, 2014 15:16
RestKit Core Data concurrency problems (fix applied)
2014-08-31 19:13:18.928 SportUp[1006:410f] Invalid concurrent access to managed object calling 'release'; Stacktrace: (
0 SportUp 0x002a320b ValidateConcurrency + 267
1 SportUp 0x002a2e04 CustomSubclassRelease + 36
2 libobjc.A.dylib 0x02ce5e97 objc_release + 71
3 SportUp 0x0032cdeb RKManagedObjectsFromMappingResultWithMappingInfo + 1147
4 SportUp 0x0032c344 -[RKManagedObjectRequestOperation deleteLocalObjectsMissingFromMappingResult:error:] + 1188
5 SportUp 0x00329ba5 __79-[RKManagedObjectRequestOperation performMappingOnResponseWithCompletionBlock:]_block_invoke356 + 1589
6 SportUp 0x0038d634 -[RKResponseMapperOperation willFinish] + 788
7 SportUp 0x0038e6c1 -[RKResponseMapperOperation main] + 4161
8 Foundation 0x01095c79 -[__NSOperationInternal

Howdy howdy, NSHipsters!

If you alloc init an NSCalendar, you'll notice that New Year's Eve falls on a Monday this year, a.k.a. "the day NSHipster is published every week". What fun!

So in celebration of the upcoming year++, I thought it'd be fun to compile a list of some of your favorite tips and tricks of the trade. Submit your favorite piece of Objective-C trivia, framework arcana, hidden Xcode feature, or anything else you think is cool, and you could have it featured in the year-end blowout article. Just comment on this gist below!

Here are a few examples of the kind of things I'd like to see:

@stanislaw
stanislaw / ruby-vips-vs-oil.rb
Created July 29, 2012 14:35
Ruby-vips vs Oil
#!/usr/bin/env ruby
require 'rubygems'
gem 'ruby-vips'
gem 'oil'
require 'vips'
require 'oil'
@stanislaw
stanislaw / gist:3132473
Created July 17, 2012 22:09
ruby-vips spec segmentation fault
/home/stanislaw/work/gems/ruby-vips/spec/vips/relational_spec.rb:31: [BUG]
Segmentation fault
ruby 1.9.3p125 (2012-02-16 revision 34643) [i686-linux]
-- Control frame information -----------------------------------------------
c:0022 p:---- s:0081 b:0081 l:000080 d:000080 CFUNC :more
c:0021 p:0020 s:0077 b:0077 l:000f54 d:000076 BLOCK
/home/stanislaw/work/gems/ruby-vips/spec/vips/relational_spec.rb:31
c:0020 p:---- s:0074 b:0074 l:000073 d:000073 FINISH
c:0019 p:---- s:0072 b:0072 l:000071 d:000071 CFUNC :instance_eval
@stanislaw
stanislaw / sunrise.rb
Created March 25, 2012 21:23 — forked from njh/sunrise.rb
Ruby Code to calculate sunrise and sunset times where I live
#!/usr/bin/env ruby
require 'rubygems'
require 'solareventcalculator'
solar = SolarEventCalculator.new(Date.today, BigDecimal.new('51.563'), BigDecimal.new('-0.499'))
puts "Sunrise: #{solar.compute_utc_civil_sunrise.getlocal}"
puts "Sunset: #{solar.compute_utc_civil_sunset.getlocal}"
@stanislaw
stanislaw / gist:2049280
Created March 16, 2012 09:32
Cucumber & Capybara against Spork - Always run tests in the same browser.
require 'rubygems'
require 'spork'
ENV["RAILS_ENV"] = 'test'
Spork.prefork do
require 'cucumber/rails'
require 'capybara/rails'