Skip to content

Instantly share code, notes, and snippets.

@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
@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
#!/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
Ну условно говоря:
Модеь: АААА! Давление 1960 на 1230!!!
Viewmodel : состояние лампочки: красное
View; Окей, отобразим ! красным
# и в обратную сторону
(Пользователь жмет педальку)
View : -> ViewModel
Слушай, тут пользователь жмякнул педальку.
/// DO CHANGE
///
self = [super init];
if (self == nil) {
return nil;
}
///
self = [super init];
if (self == nil) return nil;
//
// COBasicSequence.m
// DevelopmentApp
//
// Created by Stanislaw Pankevich on 24/10/15.
// Copyright © 2015 Stanislaw Pankevich. All rights reserved.
//
#import "Sequence.h"
#import <CompositeOperations/COSimpleOperation.h>
NAME=AFNetworking
VERSION=2.5.4
GH_REPO=AFNetworking/AFNetworking
### Paths
COMPONENTS_CACHE_PATH ?= $HOME/Library/Caches/Ports
COMPONENT_CACHE_PATH=$(COMPONENTS_CACHE_PATH)/$(NAME)
COMPONENT_SOURCE_PATH=$(COMPONENT_CACHE_PATH)/$(NAME)-${VERSION}
ZIPBALL_PATH=$(COMPONENT_CACHE_PATH)/$(NAME)-$(VERSION).zip
@stanislaw
stanislaw / utf8.c
Created November 19, 2015 23:09
Some C functions to work with UTF-8 string : you can check if a string is valid UTF-8, get the length of a UTF-8 string and replace things in a UTF-8 string. All `char *` arguments must be regular, null-byte terminated, C strings. I've tried to optimize the best I could. I'd be grateful for any suggestions or improvements. Please note I have onl…
//
// utf8.c
// training
//
// Created by Conrad Kleinespel on 5/27/13.
// Copyright (c) 2013 Conrad Kleinespel. All rights reserved.
//
#include <stdio.h>
#include <stdlib.h>
@stanislaw
stanislaw / TriangleType.swift
Last active July 28, 2017 15:54
Test Triangle Type (exercise from Kent Beck's "Test-Driven Development by Example")
//
// TriangleTest.swift
// TriangleTest
//
// Created by Stanislaw Pankevich on 24/01/16.
// Copyright © 2016 Stanislaw Pankevich. All rights reserved.
//
import XCTest
@stanislaw
stanislaw / build-report.groovy
Created June 10, 2016 10:07 — forked from x-cray/build-report.groovy
Jenkins email-ext plugin groovy template. Generates build report. Based on http://techkriti.wordpress.com/2008/08/30/using-groovy-with-hudson-to-send-rich-text-email/
<!DOCTYPE html>
<head>
<title>Build report</title>
<style type="text/css">
body
{
margin: 0px;
padding: 15px;
}