Giter Site home page Giter Site logo

erykioscommon's Introduction

ErykIosCommon

Description

Common stuff shared across iOS projects in Swift.

Author

[email protected]

License

ErykIosCommon is available under the MIT license. See the LICENSE file for more info.

Common errors

  • Object not mapped
    • (required initializer) required public init?(map: Map) {
    • (optional variable) var data: T?
    • (generic conforms to mappable) ApiResponse<T: Mappable>

Handful scripts

find . -mindepth 1 -name '.kt' -printf '%h %f\n' | sort -t ' ' -k 2,2 | uniq -f 1 --all-repeated=separate | tr ' ' '/'

Find file deleted in git

git log --all --full-history -- */xxxx.java

Strip comments

awk '!/^ *#/ && NF' file

Restart xCode

kill $(ps aux | grep 'Xcode' | awk '{print $2}')
open -a Xcode *.xcworkspace

Autocorrect

cd ../softraiostemplate && ../Pods/SwiftLint/swiftlint autocorrect

xCode version

/usr/bin/xcodebuild -version

Find duplicates

fdupes -r esoftra ErykIosCommon/ErykIosCommon SoftraIosCommon/SoftraIosCommon
find ErykIosCommon/ErykIosCommon SoftraIosCommon/SoftraIosCommon -type f -exec basename {} \; | sort | uniq -d

Handful urls

makeappicon.com/ objectivec2swift.com/#/converter/code/

Handful snippets

Generic array static func

public static func getByType<T: Sequence, Element: AnyObject>(from arr: T, withType type: Element.Type) -> Element? where T.Element == Element {
    for elem in arr {
        if elem is Element {
            return elem
        }
    }
    return nil
}

Generic array extension

extension Sequence {
    func callAll<T>(t: T) where Element == Listener<T> {
        self.forEach { $0(t) }
    }
}

erykioscommon's People

Contributors

dagi12 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.