##Encoding current time
(new Date).getTime().toString(36)##Decoding milliseconds in radix into a date
new Date(parseInt("radixDate", 36))| git diff @{1} --name-only --diff-filter=A |
##Encoding current time
(new Date).getTime().toString(36)##Decoding milliseconds in radix into a date
new Date(parseInt("radixDate", 36))| // | |
| // ConstraintOperators.swift | |
| // | |
| // Created by Damiaan Dufaux on 10/12/15. | |
| // Copyright © 2015 Damiaan Dufaux. All rights reserved. | |
| // | |
| import Foundation | |
| import UIKit |
| meteor mongo domain.com --url | |
| mongodump -u username -p password --host production-db-c1.meteor.io --port 27017 -d database |
| ffmpeg -y -r 30 -f image2pipe -vcodec ppm -i ./scene.ppm -vcodec libx264 -pix_fmt yuv420p -f mov -preset fast -crf 2 -threads 0 ./scene.mov |
| source /opt/ros/indigo/setup.bash |
| public protocol CommaSeparatedValueCompatible { | |
| init(values: [String]) throws | |
| } | |
| public func arrayFromCSV<Record: CommaSeparatedValueCompatible>(at file: URL, lineSeparator: String = "\n", columnSeparator: String = ",") throws -> [Record] { | |
| let lines = try String(contentsOf: file).trimmingCharacters(in: CharacterSet(charactersIn: lineSeparator)).components(separatedBy: lineSeparator) | |
| return try lines.dropFirst().map { line in | |
| return try Record(values: line.components(separatedBy: columnSeparator)) | |
| } | |
| } |
| // | |
| // SortedArray.swift | |
| // | |
| // Created by Damiaan on 05-11-16. | |
| // Copyright © 2016 Damiaan. All rights reserved. | |
| // | |
| import Foundation | |
| public struct SortedArray<Element>: RandomAccessCollection, Collection { |
| function highlight(highlightedElement) { | |
| var restore = [] | |
| const oldRadius = highlightedElement.style.borderRadius | |
| const oldShadow = highlightedElement.style.boxShadow | |
| restore.push(() => {highlightedElement.style.borderRadius = oldRadius; highlightedElement.style.boxShadow = oldShadow}) | |
| highlightedElement.style.borderRadius = "1px" | |
| highlightedElement.style.boxShadow = "0 0 0 4px white , 2px 2px 10px 4px rgba(0, 0, 0, 0.39)" | |
| const timer = setTimeout(function() { |
| extension Sequence { | |
| func find<Property, Argument>(where predicate: (propertyPath: KeyPath<Self.Element, Property>, comparator: (Property, Argument)->Bool, argument: Argument)) -> [Self.Element] { | |
| return filter { predicate.comparator($0[keyPath: predicate.propertyPath], predicate.argument) } | |
| } | |
| // A more specialised version: | |
| func find(where characteristic: KeyPath<Self.Element, Bool>) -> [Self.Element] { | |
| return filter { $0[keyPath: characteristic] } | |
| } | |
| } |