Skip to content

Instantly share code, notes, and snippets.

@dodikk
dodikk / gist:8bfc07edeb29aadbce69
Created November 29, 2014 19:19
Carthage build
Last login: Sat Nov 29 20:54:14 on ttys008
dodikk-MacBook:Carthage dodikk$ make package
rm -f "Carthage.pkg"
rm -rf "/tmp/Carthage.dst"
xcodebuild -workspace 'Carthage.xcworkspace' -scheme 'carthage' clean
2014-11-29 21:08:34.499 xcodebuild[25139:1007] [MT] DVTSDK: Warning: SDK path collision for path '<DVTFilePath:0x7fb9e2d0f640:'/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk'>': SDK with name 'iphonesimulator8.1' being superceded by SDK with 'iphonesimulator8.1'.
2014-11-29 21:08:34.502 xcodebuild[25139:1007] [MT] DVTSDK: Warning: SDK path collision for path '<DVTFilePath:0x7fb9e2f36840:'/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk'>': SDK with name 'iphoneos8.1' being superceded by SDK with 'iphoneos8.1'.
=== CLEAN TARGET LlamaKit-Mac OF PROJECT LlamaKit WITH CONFIGURATION Debug ===
Check dependencies
@dodikk
dodikk / OnPageSelected.js
Last active August 29, 2015 14:13
Attempting to show a selected div in fullscreen mode but UIWebView does not apply changes
$('#p39485').addClass('overlay');
@dodikk
dodikk / 1.cs
Created January 26, 2015 10:43
On Generic Parameters Naming. Which one is better?
public interface IRestApiCallTasks<TRequest, THttpResult, TResult>
{
Task<string> BuildRequestUrlForRequestAsync( TRequest request );
Task<THttpResult> SendRequestForUrlAsync( string requestUrl );
Task<TResult> ParseResponseDataAsync(THttpResult httpData);
}
@dodikk
dodikk / build_commands.sh
Created February 4, 2015 16:21
xcodebuild do-s and don't-s
xcodebuild -workspace XYZ -target xyzApp
## это - хрень. Не делай так
xcodebuild -project XYZ.xcodeproj -scheme abcApp
## это - тоже хрень.
xcodebuild -workspace XYZ -scheme abcApp
## так - нормально, но нужна shared scheme
xcodebuild -project XYZ.xcodeproj -target xyzApp
@dodikk
dodikk / RunXcodebuild.sh
Created February 10, 2015 09:15
Xctool "not configured for the build action"
dodikk$ xcodebuild -workspace HealthJoy_iPhone_UnitTests.xcworkspace -scheme "HealthJoyAuthentication-UnitTest-CI" -sdk iphonesimulator test | tee xcodebuild.log
Build settings from command line:
SDKROOT = iphonesimulator8.1
=== BUILD TARGET HealthJoyAuthentication OF PROJECT HealthJoyAuthentication WITH CONFIGURATION Debug ===
Check dependencies
@dodikk
dodikk / import.mm
Last active August 29, 2015 14:15
Import protocol to coredata
-(void)importMessageFromWebSocket:(id<HJMessage>)singleMessage
{
NSPredicate* findExistingMessage =
[NSPredicate predicateWithFormat: @"(identifier == %@) && (conversation.identifier == %@)",
singleMessage.messageId,
singleMessage.roomId];
NSManagedObjectContext* context = [NSManagedObjectContext MR_contextForCurrentThread];
@dodikk
dodikk / BuildAndAnalyze.sh
Created February 26, 2015 09:01
Scan-build error
#!/bin/bash
LAUNCH_DIR=$PWD
cd ..
REPOSITORY_ROOT=$PWD
@dodikk
dodikk / test-log.txt
Created March 4, 2015 14:44
Double negation test
2015-03-04 16:43:36.566 [7773:1208001] Non Zero 1
2015-03-04 16:43:36.567 [7773:1208001] Non Zero 2
@dodikk
dodikk / BoolFromCast.mm
Created March 5, 2015 10:33
Implicit casting int ==> BOOL
int x;
BOOL* px = reinterpret_cast<BOOL*>(&x);
BOOL castedAndTruncated = *px;
// так - точно “обрежет”. Но чтобы compiler такое сам творил…
@dodikk
dodikk / 1-CompleteLoginVC.mm
Created March 31, 2015 08:51
[bug] UINavigationController Zombie
-(void)navigateToMainMenu:(UINavigationController *)mainMenuViewController
{
id<HJDateOfBirthSurveyLogger> logger = self.dobSurveyLogger;
dispatch_async(dispatch_get_main_queue(), ^void()
{
[logger logNavigatingToMainMenu];
UIWindow *window = [UIApplication sharedApplication].keyWindow;