This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| actual fun StringBuilder.replace(start: Int, end: Int, replacement: String) = apply { | |
| check(start in 0 .. length) { "start must be in 0 .. $length: $start" } | |
| check(end in start .. length) { "end must be in $start .. $length: $end" } | |
| when { | |
| start == end -> Unit | |
| start == 0 -> | |
| when (end) { | |
| length -> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import io.ktor.application.ApplicationCallPipeline | |
| import io.ktor.application.ApplicationFeature | |
| import io.ktor.application.call | |
| import io.ktor.features.ContentNegotiation | |
| import io.ktor.features.UnsupportedMediaTypeException | |
| import io.ktor.http.HttpMethod | |
| import io.ktor.http.HttpStatusCode | |
| import io.ktor.http.content.HttpStatusCodeContent | |
| import io.ktor.http.content.OutgoingContent | |
| import io.ktor.http.content.transformDefaultContent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const contenteditableElement = … | |
| const selection = window.getSelection() | |
| selection.selectAllChildren(contenteditableElement) | |
| selection.collapseToEnd() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.github.fluidsonic.nestedrecyclerview | |
| import android.content.Context | |
| import android.support.v4.view.NestedScrollingParent | |
| import android.support.v7.widget.RecyclerView | |
| import android.util.AttributeSet | |
| import android.view.MotionEvent | |
| import android.view.View | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| protocol _TypeerasedOptional { | |
| var typeerasedSelf: Any? { get } | |
| } | |
| extension Optional: _TypeerasedOptional { | |
| var typeerasedSelf: Any? { | |
| guard let value = self else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| workspace 'OurApp' | |
| xcodeproj 'App' | |
| platform :ios, '8.2' | |
| use_frameworks! | |
| link_with 'App Store', 'Beta', 'Development', 'Testing' | |
| # a lot of pods here | |
| pre_install do |installer| | |
| # workaround for https://github.com/CocoaPods/CocoaPods/issues/3957 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct Path: CustomStringConvertible { | |
| private var hasParent = HasParent.No | |
| var key: String | |
| init(forKey key: String, inParent parent: Path? = nil) { | |
| self.key = key | |
| self.parent = parent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (lldb) po 0x7c953600 // UISplitViewController | |
| <UISplitViewController: 0x7c953600> | |
| (lldb) po [0x7c953600 childViewControllers] // UISplitViewController's children | |
| NSArray( | |
| <UIViewController: 0x7be5a6e0>, | |
| <UIViewController: 0x7be9b130> | |
| ) | |
| (lldb) po [0x7be5a6e0 parentViewController] // master child's parent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| VIEW CONTROLLER LIFECYCLE BROKEN! | |
| MFMailComposeInternalViewController (indirectly) called super.viewDidAppear() multiple times. | |
| Possible causes: | |
| - MFMailComposeInternalViewController or one of its superclasses called super.viewDidAppear() multiple times | |
| - it was called manually (it should never be called manually) | |
| - the controller containment implementation of MFMailComposeViewController or one if its parents is broken |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (lldb) po 0x12fbada50 | |
| <UIPageControl: 0x12fbada50; frame = (134.5 46.5; 7 37); autoresize = W; userInteractionEnabled = NO; layer = <WLayer: 0x12fbabe80>> | |
| (lldb) p (NSInteger)[0x12fbada50 numberOfPages] | |
| (NSInteger) $2 = 1 | |
| (lldb) p (NSInteger)[0x12fbada50 currentPage] | |
| (NSInteger) $3 = 0 | |
| (lldb) p (void)[0x12fbada50 setCurrentPage:1] |