Skip to content

Instantly share code, notes, and snippets.

View nikolaykasyanov's full-sized avatar

Nikolay Kasyanov nikolaykasyanov

  • Careem
  • Berlin, Germany
View GitHub Profile
@nikolaykasyanov
nikolaykasyanov / C138FB1B-8C83-477C-B33C-05551516167A.codesnippet
Last active November 27, 2016 14:49
__auto_type autocompletion snippet for Xcode 8+. Just put it in ~/Library/Developer/Xcode/UserData/CodeSnippets/ and then start typing aut... in Xcode.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDECodeSnippetCompletionPrefix</key>
<string>auto</string>
<key>IDECodeSnippetCompletionScopes</key>
<array>
<string>CodeBlock</string>
</array>
require 'json'
require 'net/http'
module Fastlane
module Actions
class MfbLatestHockeyBuildAction < Action
def self.run(config)
host_uri = URI.parse('https://rink.hockeyapp.net')
http = Net::HTTP.new(host_uri.host, host_uri.port)
http.use_ssl = true
@nikolaykasyanov
nikolaykasyanov / grading.md
Last active May 4, 2016 16:18
FlixBus iOS coding challenge assessment criteria

FlixBus iOS coding challenge assessment

Primary criteria

ABSOLUTE MUST

  • Project builds & runs on required iOS versions
  • Date/times are displayed in correct timezone

Consistent code style

public protocol DBWorker2 {
associatedtype S: SequenceType
func fetchObjectsFromStorage(type: S.Generator.Element.Type) -> Observable<S.Generator.Element>
func saveObjectsToStorage(objects: S) -> Observable<Void>
}
public class DBWorker2Impl: DBWorker2 {
public func fetchObjectsFromStorage(type: Item.Type) -> Observable<Item> {
return Observable()
@import UIKit;
NS_ASSUME_NONNULL_BEGIN
@protocol MFBPreviewableCollectionView
- (nullable NSIndexPath *)mfb_previewableCollectionIndexPathForItemAtPoint:(CGPoint)point;
- (CGRect)mfb_previewableCollectionItemRectForIndexPath:(NSIndexPath *)indexPath;
@nikolaykasyanov
nikolaykasyanov / jpeg_memory_src.c
Created October 24, 2012 14:07
Memory source for libjpeg-turbo
#include "jpeg_memory_src.h"
/// JPEG source manager
struct jpeg_source_t
{
struct jpeg_source_mgr _pub;
const char *_begin;
const char *_end;
};
@nikolaykasyanov
nikolaykasyanov / deployment-target-patch.diff
Last active December 30, 2015 18:28
Patches to be used with Ogre homebrew formula
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -237,10 +237,15 @@
remove_definitions(-msse)
elseif (APPLE AND NOT OGRE_BUILD_PLATFORM_APPLE_IOS)
- # Set 10.5 as the base SDK by default
+ # Set 10.6 as the base SDK by default
set(XCODE_ATTRIBUTE_SDKROOT macosx)
@nikolaykasyanov
nikolaykasyanov / LICENSE.txt
Last active December 27, 2015 18:39
Script for Jenkins CI that extracts annotation of most recent annotated tag to file. This file then can be used as a release notes for TestFlight/HockeyApp deployment. Scriptler plugin is required.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@nikolaykasyanov
nikolaykasyanov / Ogre.patch
Created October 23, 2013 05:12
Patch for Ogre 1.8.1 release that add compatibility with recent Xcode versions.
# HG changeset patch
# User Nikolay Kasyanov <corrmage@gmail.com>
# Date 1375029954 -14400
# Branch v1-8
# Node ID 37b1f1b3c594019b2131828ae7d942f53d6a4738
# Parent 525a7f3bcd4e51b1085c42a8b55fe07eb7700458
Fix build on CMake >= 2.8.10
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
@nikolaykasyanov
nikolaykasyanov / rotation.m
Last active December 21, 2015 20:58
Rotation handling in reactive style. Kinda complex =\
RACSignal *contentOffsetSignal = RACObserve(webView.scrollView, contentOffset);
RACSignal *contentSizeSignal = RACObserve(webView.scrollView, contentSize);
RACSignal *willRotateSignal = [self rac_signalForSelector:@selector(willRotateToInterfaceOrientation:duration:)];
// Sends @YES everytime orientation changes from portrait to landscape or vice-versa.
// will not send anything if changed from portrait to portrait upside down, for example.
RACSignal *orientationTypeChangedSignal = [[[willRotateSignal map:^(RACTuple *value) {
return value.first;
}] combinePreviousWithStart:@(self.interfaceOrientation)