Skip to content

Instantly share code, notes, and snippets.

View candostdagdeviren's full-sized avatar

Candost candostdagdeviren

View GitHub Profile
@candostdagdeviren
candostdagdeviren / Fastfile
Created May 7, 2018 12:45
iOS Fastfile Example for Flutter application Fastlane integration
fastlane_version "2.84.0"
xcversion(version: "9.2")
default_platform :ios
lane :certificates do
match(
app_identifier: ["com.jimdo.boost"],
type: "appstore",
readonly: true)
@candostdagdeviren
candostdagdeviren / Fastfile
Last active May 11, 2023 04:41
Android Fastfile Example for Flutter application Fastlane integration
default_platform(:android)
platform :android do
desc "Submit a new QA Build to Crashlytics Beta"
lane :qa do
crashlytics(
api_token: 'CRASHLYTICS_API_TOKEN',
build_secret: 'CRASHLYTICS_BUILD_SECRET',
notes_path: 'qa-change.log',
class OurCoolCollection: RouteCollection {
func build(_ builder: RouteBuilder) throws { ... }
}
class OurCoolCollection: RouteCollection {
typealias Wrapped = HTTP.Responder
func build<Builder: RouteBuilder>(_ builder: Builder) where Builder.Value == Responder { ... }
}
extension User: JSONRepresentable {
func makeJSON() throws -> JSON {
var json = JSON()
try json.set("id", id?.string)
try json.set("name", name)
try json.set("score", score)
return json
}
}
final class User: Model {
let storage = Storage()
var name: String
var score: Int
init(row: Row) throws {
name = try row.get("name")
score = try row.get("score")
}
func makeRow() throws -> Row {
final class User: Model {
init(node: Node, in context: Context) throws {
id = try node.extract("_id") // Trick for MongoDB database
name = try node.extract("name")
score = try node.extract("score")
}
func makeNode(context: Context) throws -> Node {
return try Node(node: [
"_id": id, // Trick for MongoDB database
@candostdagdeviren
candostdagdeviren / NewPackage.swift
Created May 21, 2017 05:43
Vapor 1 -> 2 Migration
dependencies: [
.Package(url: "https://github.com/vapor/vapor.git", majorVersion: 2),
.Package(url: "https://github.com/vapor/mongo-provider.git", majorVersion: 2)
]
@candostdagdeviren
candostdagdeviren / OldPackage.swift
Created May 21, 2017 05:42
Vapor 1 -> 2 Migration
dependencies: [
.Package(url: "https://github.com/vapor/vapor.git", majorVersion: 1, minor: 5),
.Package(url: "https://github.com/vapor/mongo-provider.git", majorVersion: 1, minor: 1)
]
@candostdagdeviren
candostdagdeviren / pre-commit
Last active April 22, 2023 09:32
Git Pre-Commit hook with SwiftLInt
#!/bin/bash
#Path to swiftlint
SWIFT_LINT=/usr/local/bin/swiftlint
#if $SWIFT_LINT >/dev/null 2>&1; then
if [[ -e "${SWIFT_LINT}" ]]; then
count=0
for file_path in $(git ls-files -m --exclude-from=.gitignore | grep ".swift$"); do
export SCRIPT_INPUT_FILE_$count=$file_path