Skip to content

Instantly share code, notes, and snippets.

View lifely's full-sized avatar

Julien Di Marco lifely

View GitHub Profile
@lifely
lifely / FastFile.rb
Created January 11, 2022 15:26
Fastlane fix for archives.
fastlane_require('plist')
fastlane_require('gym')
fastlane_require('pp')
fastlane_require('tiny_url')
class Gym::Runner
# The only way to run my custom method after the pod integrates with the project (http://blog.bigbinary.com/2012/01/08/alias-vs-alias-method.html)
# Repace the method implementation integrate_user_project with ours
alias_method :verify_archive_legacy, :verify_archive
@lifely
lifely / RealmSwift.podspec
Created March 31, 2019 19:06
Realm Vendored
Pod::Spec.new do |s|
s.name = 'RealmSwift'
s.version = '3.13.1'
s.summary = 'Realm is a modern data framework & database for iOS, macOS, tvOS & watchOS.'
s.description = <<-DESC
The Realm Mobile Database, for Swift. (If you want to use Realm from Objective-C, see the “Realm” pod.)
The Realm Mobile Database is a fast, easy-to-use replacement for Core Data & SQLite. Use it with the Realm Mobile Platform for realtime, automatic data sync. Works on iOS, macOS, tvOS & watchOS. Learn more and get help at https://realm.io.
DESC
@lifely
lifely / golden-path-swift.md
Created February 5, 2019 13:27
Golden Path

Golden Path

When coding with conditionals, the left-hand margin of the code should be the "golden" or "happy" path. That is, don't nest if statements. Multiple return statements are OK. The guard statement is built for this.

Preferred:

func computeFFT(context: Context?, inputData: InputData?) throws -> Frequencies {

  guard let context = context else {
 throw FFTError.noContext
@lifely
lifely / test.json
Last active February 10, 2016 21:50
[{
"id": 341,
"expiresAt": "2016-05-08T23:59:59+00:00",
"usedAt": null,
"membershipId": 311,
"nbPoints": 30,
"createdAt": "2016-02-09T12:51:59+00:00",
"burnProducts": [{
"pmix": "2040",
"label": "BIG MAC\u2122",
//
// BitwiseOptions.swift
//
// Created by Gregory Higley on 11/24/14.
// Copyright (c) 2014 Prosumma LLC. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
[Quote-selection] asker selected a quote a should pre-pay now:
'Optional(https://stage-secure-gateway.hipay-tpp.com/payment/web/pay/60d1a9f1-4b24-4a82-b3fd-2675842fed2d)'
[deposit-payment] webView:decidePolicyForNavigationAction: https://stage-secure-gateway.hipay-tpp.com/payment/web/pay/60d1a9f1-4b24-4a82-b3fd-2675842fed2d
[deposit-payment] webView:decidePolicyForNavigationResponse:
[deposit-payment] webView:decidePolicyForNavigationAction: https://test-psp.hipay.com/HiMediaPSP-war/Token.xhtml?p=MXPrDJr9zudQcQnVbDYKDie5a%2BwfqIzjiRZCyLuJLSu6vQH1DmuAPw%2BhxIZqQXcVwqFBBZwy7aX5MbIkhRRCl7qDwHpCaDK8XNJz360oZqRjAf3ptNlOZzMGOELwkMFpuHmh1p%2FXmgU5KDgrLLE8929lg%2F%2BCt2ralrYnmlq78D7sMyMpmg3CsrDxakCy6ENzKjQ8uLCwcYb0tHcwnhBrOIJoRVdk5PO4pKUcEikFMSc7muov0oPBBDawMfwf4uDfaMepy2AidMnQyktamVyj0QMW0p4UvP9SZddLYGVJPfRgYfOtkeYdfrz7wjQzeQscuutGBK8fzwv99WodEvrDMgmxMt4uGyUMRDQKibRcz8lQcQnVbDYKDie5a%2BwfqIzjbGfvzeeQE4x3QU8p2qlOrJws9K%2BN5R5kKkmbE3ibkjE%3D
[deposit-payment] webView:decidePolicyForNavigationResponse:
[deposit-payme
@lifely
lifely / UIStaticTableViewController.swift
Last active August 29, 2015 14:22
UIStaticTableViewController
//
// HamakDynamicController.swift
// Hamak
//
// Created by Julien Di Marco on 03/06/15.
// Copyright (c) 2015 SoLocal. All rights reserved.
//
import Foundation
@lifely
lifely / StringFromClass
Created March 7, 2015 13:58
NSStringFromClass Swift Workaround
func NSStringFromAnyClass(aClass: AnyClass!) -> String! {
return NSStringFromClass(aClass).componentsSeparatedByString(".").last!
}
@lifely
lifely / linear-obj-c
Last active August 29, 2015 14:15
Fail or Continue - Paradigme
NSArray *developerList = nil;
if (!responseObject || !(developerList = [responseObject objectForKey:@"list"]) ||
![developerList isKindOfClass:[NSArray class]])
return ; // call error/failure block
NSArray *developers = [SFService prepareObjectFromResponse:developerList forObjectClass:[SFDeveloper class]];
NSLog(@"[SUCCESS][SFService-api] Action /trombi/ : \n%@", developers);
@lifely
lifely / gist:f69b9a954f6e6153860d
Created May 5, 2014 08:41
Phone Number Regex
^(?:(?:\(?(?:00|\+)([1-4]\d\d|[1-9]\d?)\)?)?[\-\.\ \\\/]?)?((?:\(?\d{1,}\)?[\-\.\ \\\/]?){0,})(?:[\-\.\ \\\/]?(?:#|ext\.?|extension|x)[\-\.\ \\\/]?(\d+))?$