Skip to content

Instantly share code, notes, and snippets.

Felix M. fxm90

Block or report user

Report or block fxm90

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
tweetjay / .swiftlint.yml
Created Oct 24, 2017
Swiftlint configuration file
View .swiftlint.yml
- Pods
- Cartography
- build
disabled_rules: # rule identifiers to exclude from running
# - cyclomatic_complexity
- trailing_whitespace
freak4pc / MKMultiPoint+Ext.swift
Last active Nov 20, 2019
Get a list of coordinates from a MKPolyline / MKRoute
View MKMultiPoint+Ext.swift
public extension MKMultiPoint {
var coordinates: [CLLocationCoordinate2D] {
var coords = [CLLocationCoordinate2D](repeating: kCLLocationCoordinate2DInvalid,
count: pointCount)
getCoordinates(&coords, range: NSRange(location: 0, length: pointCount))
return coords
keybuk /
Last active Mar 10, 2019
Why the `where` clause in Swift's `for` loops matter

An important goal in Swift is clarity at the point of use, this appears in the API Design Guidelines as a fundamental, but also pervades the design of the Swift language itself.

I think that removing the where clause from Swift's for loops reduces clarity.

It may be that there are other ways to express the same code result, but "only one way to do it" has never been a Swift goal that I'm aware of, and an identical result does not necessarily equate to an identical intent.

Consider the following, which was actually a source of brief confusion for me while reading some of your code.

Example 1:

parmentf /
Last active Nov 21, 2019
Git Commit message Emoji
gonzalezreal /
Last active Nov 11, 2019
iOS Cell Registration & Reusing with Swift Protocol Extensions and Generics

iOS Cell Registration & Reusing with Swift Protocol Extensions and Generics

A common task when developing iOS apps is to register custom cell subclasses for both UITableView and UICollectionView. Well, that is if you don’t use Storyboards, of course.

Both UITableView and UICollectionView offer a similar API to register custom cell classes:

public func registerClass(cellClass: AnyClass?, forCellWithReuseIdentifier identifier: String)
public func registerNib(nib: UINib?, forCellWithReuseIdentifier identifier: String)
andjosh / animatedScrollTo.js
Created Sep 30, 2013
ScrollTo animation using pure javascript and no jquery
View animatedScrollTo.js
document.getElementsByTagName('button')[0].onclick = function () {
scrollTo(document.body, 0, 1250);
function scrollTo(element, to, duration) {
var start = element.scrollTop,
change = to - start,
currentTime = 0,
increment = 20;
gre / easing.js
Last active Nov 21, 2019
Simple Easing Functions in Javascript - see
View easing.js
* Easing Functions - inspired from
* only considering the t value for the range [0, 1] => [0, 1]
EasingFunctions = {
// no easing, no acceleration
linear: function (t) { return t },
// accelerating from zero velocity
easeInQuad: function (t) { return t*t },
// decelerating to zero velocity
You can’t perform that action at this time.