Skip to content

Instantly share code, notes, and snippets.

//
// GSSimpleImageView.swift
// GSSimpleImage
//
// Created by 胡秋实 on 16/1/2016.
// Copyright © 2016 CocoaPods. All rights reserved.
//
import UIKit
/* 3.1 */
// 1. Write Pseudo code find a given element in an array
func linearSearch<T: Equatable>(target: T, in array: [T]) {
for (index, element) in array.enumerated() {
if element == target {
print("Found \(element) at \(index)")
break
} else if (index == array.count) {
print("The target \(target) not found")
@williamhqs
williamhqs / Test.playground
Last active May 13, 2020 10:21
ProperyWrapper decode
import UIKit
let jsonString =
"""
{
"name": "Tim",
"age": "28"
}
"""
git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
npm config delete proxy