Skip to content

Instantly share code, notes, and snippets.

View ignazioc's full-sized avatar
:octocat:

Ignazio ignazioc

:octocat:
View GitHub Profile

Keybase proof

I hereby claim:

  • I am ignazioc on github.
  • I am ignazioc (https://keybase.io/ignazioc) on keybase.
  • I have a public key whose fingerprint is 40DB 4C53 E3B1 6F85 5CC2 B45B 6A22 414B 04AC FACA

To claim this, I am signing this object:

@ignazioc
ignazioc / indirect enum.swift
Created February 12, 2017 21:07
Example of indirect enum with Swift3
import Cocoa
enum DataStructure {
case node(value: String)
indirect case tree(left: DataStructure, right: DataStructure)
}
let nodeA = DataStructure.node(value: "A")
let nodeB = DataStructure.node(value: "B")
@ignazioc
ignazioc / autoclousure.swift
Created February 12, 2017 10:39
A simple explanation of the @autoclosure keyword
/*:
### Swift 3 @autoclosure
*/
import Cocoa
// Let's suppose this is complex funcion with lookup database etc.
func nextOrderNumber() -> Int {
return 1000
}
//: Playground - noun: a place where people can play
import UIKit
import PlaygroundSupport
struct User {
var name: String
init() {
{
"flags": [
{
"featureName": "ads_audioload_frequency",
"cell": "Control"
},
{
"featureName": "NTX_artist_published_playlists_position",
"cell": "B"
},
import UIKit
import PlaygroundSupport
class MyViewController : UIViewController {
override func loadView() {
let view = UIView()
view.backgroundColor = .gray
let textView = UITextView(frame: CGRect(x: 20.0, y: 30.0, width: 300.0, height: 400.0))
textView.textColor = UIColor.blue
if v1 {
if (v2) {
print("tt")
} else {
print("tf")
}
} else {
if v2 {
print("ft")
} else {
for server in macmini07-ios macmini08-android macmini09-ios macmini10-android macmini11-ios macmini12-android;
do
ssh -i ~/.ssh/remoteJenkins jenkins@${server} < script.sh
scp -i ~/.ssh/remoteJenkins jenkins@${server}:~/report.txt ./report_${server}.txt
for REPORT in `ls report*`;
do
echo "$REPORT" && cat $REPORT | grep "Model: APPLE SSD"
done
done
disabled_rules: # rule identifiers to exclude from running
- line_length
- function_body_length
- cyclomatic_complexity
- multiple_closures_with_trailing_closure
- xctfail_message
# Swift 3 rules that do not make sense for Swift 2.3
- implicit_getter
disabled_rules: # rule identifiers to exclude from running
- line_length
- function_body_length
- cyclomatic_complexity
- multiple_closures_with_trailing_closure
- xctfail_message
# Swift 3 rules that do not make sense for Swift 2.3
- implicit_getter