Attention: if you attempt to fork this gist, github will think that you are a spammer and you will have to confirm that you are human with them. Apparantly there are too many links in this list. Also I update it rather frequently (see revisions on the left), so it's probably wise to not fork it anyway.
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
| extension Publisher { | |
| public func retryWhen<P>( | |
| _ handler: @escaping (AnyPublisher<Self.Failure, Never>) -> P | |
| ) -> Publishers.RetryWhen<Self, P> | |
| where P: Publisher, P.Failure == Self.Failure { | |
| Publishers.RetryWhen(source: self, handler: handler) | |
| } | |
| } | |
| extension Publishers { |
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
| extension Publisher { | |
| func enumerated() -> AnyPublisher<(Int, Self.Output), Self.Failure> { | |
| scan(Optional<(Int, Self.Output)>.none) { acc, next in | |
| guard let acc = acc else { return (0, next) } | |
| return (acc.0 + 1, next) | |
| } | |
| .map { $0! } | |
| .eraseToAnyPublisher() | |
| } | |
| } |
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
| /** | |
| * Definition for a binary tree node. | |
| * public class TreeNode { | |
| * public var val: Int | |
| * public var left: TreeNode? | |
| * public var right: TreeNode? | |
| * public init(_ val: Int) { | |
| * self.val = val | |
| * self.left = nil | |
| * self.right = nil |
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
| /** | |
| * Rostyslav Kobyzskyi | |
| * Unsigned Integer Utils | |
| */ | |
| private fun UByte.toByteArray() = toUInt().toByteArray(UByte.SIZE_BYTES) | |
| private fun UShort.toByteArray() = toUInt().toByteArray(UShort.SIZE_BYTES) | |
| private fun UInt.toByteArray() = toUInt().toByteArray(UInt.SIZE_BYTES) | |
| private fun ByteArray.toUInt() = toUByteArray() | |
| .mapIndexed { index, uByte -> uByte.toUInt() shl (UByte.SIZE_BITS * (count() - index - 1)) } |
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
| // | |
| // debounce-throttle.swift | |
| // | |
| // Created by Simon Ljungberg on 19/12/16. | |
| // License: MIT | |
| // | |
| import Foundation | |
| extension TimeInterval { |
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
| // | |
| // CBLIncrementalStore.m | |
| // CBLIncrementalStore | |
| // | |
| // Created by Christian Beer on 21.11.13. | |
| // Copyright (c) 2013 Christian Beer. All rights reserved. | |
| // | |
| #import "CBLIncrementalStore.h" |
- node.js
- Installation paths: use one of these techniques to install node and npm without having to sudo.
- Node.js HOWTO: Install Node+NPM as user (not root) under Unix OSes
- Felix's Node.js Guide
- Creating a REST API using Node.js, Express, and MongoDB
- Node Cellar Sample Application with Backbone.js, Twitter Bootstrap, Node.js, Express, and MongoDB
- JavaScript Event Loop
- Node.js for PHP programmers