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
tweetjay / .swiftlint.yml
Created Oct 24, 2017
Swiftlint configuration file
View .swiftlint.yml
included:
excluded:
- Pods
- Cartography
- build
disabled_rules: # rule identifiers to exclude from running
# - cyclomatic_complexity
- trailing_whitespace
@freak4pc
freak4pc / MKMultiPoint+Ext.swift
Last active Jul 31, 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
keybuk / ifwhere.md
Last active Mar 10, 2019
Why the `where` clause in Swift's `for` loops matter
View ifwhere.md

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
parmentf / GitCommitEmoji.md
Last active Aug 26, 2019
Git Commit message Emoji
View GitCommitEmoji.md
@gonzalezreal
gonzalezreal / ios-cell-registration-swift.md
Last active Aug 9, 2019
iOS Cell Registration & Reusing with Swift Protocol Extensions and Generics
View ios-cell-registration-swift.md

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
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
gre / easing.js
Last active Aug 26, 2019
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
View easing.js
/*
* Easing Functions - inspired from http://gizma.com/easing/
* 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.