Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View KanybekMomukeyev's full-sized avatar

Kanybek Momukeev KanybekMomukeyev

View GitHub Profile
@KanybekMomukeyev
KanybekMomukeyev / Answers to questions.
Last active August 29, 2015 13:56
Answers to questions.
//(1) Ответы на первый вопрос.
@interface Foo : SomeObject
{
NSString *_bar;
}
@property (retain) NSString *bar;
+ (id)foo;
@end
@KanybekMomukeyev
KanybekMomukeyev / dfdf.scala
Created November 14, 2014 04:32
sdfsdfsdfsdf
(1 to 4).map { i => "Happy Birthday " + (if (i == 3) "Damir" else "to You") }.foreach { println }
@KanybekMomukeyev
KanybekMomukeyev / core_data.m
Last active October 9, 2015 04:07
Core data basics
Core Data Querying Basics
Jul 13, 2014
The basics of querying, filtering, sorting, and grouping persistent data in Core Data.
Retrieving Persistent Objects
// instances of the entity to fetch
NSEntityDescription *entity
= [NSEntityDescription entityForName:@"Item"
inManagedObjectContext:self.managedObjectContext];
@KanybekMomukeyev
KanybekMomukeyev / Macros.h
Created December 7, 2015 08:25 — forked from numo16/Macros.h
Some useful iOS/Objective-C Macros
#define ApplicationDelegate ((AppDelegate *)[[UIApplication sharedApplication] delegate])
#define UserDefaults [NSUserDefaults standardUserDefaults]
#define NotificationCenter [NSNotificationCenter defaultCenter]
#define SharedApplication [UIApplication sharedApplication]
#define Bundle [NSBundle mainBundle]
#define MainScreen [UIScreen mainScreen]
#define ShowNetworkActivityIndicator() [UIApplication sharedApplication].networkActivityIndicatorVisible = YES
#define HideNetworkActivityIndicator() [UIApplication sharedApplication].networkActivityIndicatorVisible = NO
#define NetworkActivityIndicatorVisible(x) [UIApplication sharedApplication].networkActivityIndicatorVisible = x
#define NavBar self.navigationController.navigationBar
/*
* Copyright 2012 ZXing authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
/*
* Copyright 2012 ZXing authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
- (void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
[self.capture stop];
[self.capture.layer removeFromSuperlayer];
self.capture = nil;
}
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
@KanybekMomukeyev
KanybekMomukeyev / gist:5763738
Last active December 18, 2015 09:49
the implementation of Cesar crypt method
//
// CVLogicManager.m
// CesarShifr
//
// Created by Kanybek Momukeev on 6/12/13.
// Copyright (c) 2013 Kanybek Momukeev. All rights reserved.
//
#import "CVLogicManager.h"
@interface CVLogicManager()
@KanybekMomukeyev
KanybekMomukeyev / Telegram.mm
Created January 5, 2016 06:02
Telegram to save correct cell position on interface orientation change
- (void)_performOrientationChangesWithDuration:(NSTimeInterval)duration orientation:(UIInterfaceOrientation)orientation
{
bool animated = duration > DBL_EPSILON;
CGSize collectionViewSize = [self collectionViewSizeForInterfaceOrientation:orientation];
CGFloat keyboardHeight = _keyboardHeight;
if (_titlePanelWrappingView != nil)
{
CGRect titleWrapperFrame = CGRectMake(0.0f, self.controllerInset.top, collectionViewSize.width, _titlePanelWrappingView.frame.size.height);
CGRect titlePanelFrame = CGRectMake(0.0f, 0.0f, titleWrapperFrame.size.width, _currentTitlePanel.frame.size.height);
@KanybekMomukeyev
KanybekMomukeyev / testSsinglaKitAndReactiveCocoa.m
Last active May 6, 2016 04:32
Compare the speed of SSignalKit and ReactiveCocoa
@implementation GRTestRacAndSSignalKit
- (instancetype)init
{
self = [super init];
if (self != nil)
{
}
return self;
}