I hereby claim:
- I am marioiannotta on github.
- I am marioiannotta (https://keybase.io/marioiannotta) on keybase.
- I have a public key ASAvS7fOYW6pCKTTkVZlT8bdVVAd2a8ljpRk1mLawk8GfQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#!/bin/sh | |
# https://gist.github.com/MarioIannotta/e27ac3ec067dc5b6f00c392d7527b10a | |
build_path="Builds/$(date '+%d-%m-%Y-%H-%M')" | |
target="YourFramework" | |
configuration="Your configuration eg: Release" | |
# clean up the build folder if already exists | |
rm -rf build_path |
import Foundation | |
var json = """ | |
{ | |
"lastSyncDate": "2018-10-28T09:03:59+0000", | |
"posts": [ | |
{ | |
"id": 0, | |
"title": "Swift 4 Codable: tips and tricks", | |
"link": "https://medium.com/@MarioIannotta/swift-4-codable-tips-and-tricks-7ab4674736d2", |
import Foundation | |
extension Optional { | |
func or(_ wrappedItem: Wrapped) -> Wrapped { | |
return self ?? wrappedItem | |
} | |
func or(_ wrappedItem: Optional) -> Optional { | |
return self ?? wrappedItem |
import Foundation | |
extension String { | |
var stringToDateCustomMethod: Date { | |
return Date() | |
} | |
} | |
extension KeyedDecodingContainer { | |
subscript<T: Decodable>(key: KeyedDecodingContainer.Key) -> T? { |
extension KeyedDecodingContainer { | |
subscript<T: Decodable>(key: KeyedDecodingContainer.Key) -> T? { | |
return try? decode(T.self, forKey: key) | |
} | |
} |
/*! | |
* Chart.js | |
* http://chartjs.org/ | |
* Version: 2.7.0 | |
* | |
* Copyright 2017 Nick Downie | |
* Released under the MIT license | |
* https://github.com/chartjs/Chart.js/blob/master/LICENSE.md | |
*/ | |
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Chart = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,modul |
/* | |
This gist is part of the post "Handle swift logs and testing safely and painless" | |
More info here: | |
https://medium.com/@MarioIannotta/handle-swift-test-and-log-safely-c825d6006bc4#.363uu3a94 | |
*/ | |
import Foundation |
enum MIUserDefault: String { | |
case persistentStuffOne = "persistentStuffOne" | |
case persistentStuffTwo = "persistentStuffTwo" | |
case persistentStuffThree = "persistentStuffThree" | |
func set(object: AnyObject) { | |
NSUserDefaults.standardUserDefaults().setObject(object, forKey: self.rawValue) | |
} | |
func get() -> AnyObject? { |