Skip to content

Instantly share code, notes, and snippets.

@dodikk
dodikk / debounce-throttle.swift
Created February 21, 2018 11:37 — forked from simme/debounce-throttle.swift
Swift 3 debounce & throttle
//
// debounce-throttle.swift
//
// Created by Simon Ljungberg on 19/12/16.
// License: MIT
//
import Foundation
extension TimeInterval {
@dodikk
dodikk / NSObject+Debounce.h
Created February 21, 2018 11:31 — forked from berzniz/NSObject+Debounce.h
Debounce method for Objective C
@interface NSObject (Debounce)
- (void)debounce:(SEL)action delay:(NSTimeInterval)delay;
@end
@dodikk
dodikk / estimating_joke_ru.md
Last active February 21, 2018 09:32
A joke about estimating (in russian)

— Слушай, ты разработчик. Ответь, почему разработчики всегда неправильно оценивают время на создание программ?

— Представь что тебе надо разгрузить машину, сколько времени это займет?
— Пару часов
— Это камаз
— 8 часов
@dodikk
dodikk / ChatDetailsRepoRealm.swift
Created February 15, 2018 15:22
Realm Queries on Background Queue
public func storeChatDetailsAsync(
_ item: ChatDetailsInfoType,
callback: @escaping GroupChatDetailsFetchCompletion)
{
self._queue.async
{
[weak weakSelf = self] in
guard let strongSelf = weakSelf
else
import FutureKit
extension Promise {
func getCallbackForService() -> ( (Result<T>) -> Swift.Void )
{
return self.completeWithResult
}
func completeWithResult(result: Result<T>) {
@dodikk
dodikk / NumbersPadKeyValuePairView.xaml
Created February 2, 2018 10:34
[Xamarin.Forms] Control example - numbers panel
<?xml version="1.0" encoding="UTF-8"?>
<ContentView
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="SampleFormsProject.Views.NumbersPadKeyValuePairView"
xmlns:ns_sample_control="clr-namespace:SampleFormsProject.Views;assembly=SampleFormsProject"
>
<ContentView.Content>
@dodikk
dodikk / HorizontalStackControl.xaml
Last active February 1, 2018 11:32
[question] Nested stack layouts in Xamarin.Forms
<?xml version="1.0" encoding="UTF-8"?>
<ContentView
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="PracticeDashboard.Views.SalesPipeline.SelectedMonthNumbersPanel">
<ContentView.Content>
<StackLayout Orientation="Horizontal" BackgroundColor="Blue">
<BoxView Color="Red" HeightRequest="60"/>
@dodikk
dodikk / SalesPipelineNormalizedPlotBuilder.cs
Created January 29, 2018 11:46
[solved] OxyPlot columns and line series together Raw
namespace PracticeDashboard.PlotBuilders.SalesPipeline
{
using System;
using System.Collections.Generic;
using System.Linq;
using Helpers;
using global::OxyPlot;
using global::OxyPlot.Axes;
using global::OxyPlot.Series;
using PracticeDashboard.DAL.Models.SalesPipeline;
@dodikk
dodikk / PlotHelpers.cs
Last active January 29, 2018 11:49
[issue] OxyPlot columns and line series together (oxyplot #1187)
namespace PracticeDashboard.Helpers
{
using DAL.Models;
using DAL.Models.Dashboard;
using Models;
using global::OxyPlot;
using global::OxyPlot.Axes;
using global::OxyPlot.Series;
using System;
using System.Collections.Generic;
@dodikk
dodikk / TimeBasedUuidGenerator.h
Created October 23, 2017 13:30
Time based UUID generator - [obj-c] [Objective-C]
#import <Foundation/Foundation.h>
@interface TimeBasedUuidGenerator : NSObject
-(NSString*)generateTimeBasedUuid;
-(NSUUID*)generateTimeBasedUuidObject;
@end