Skip to content

Instantly share code, notes, and snippets.

View arashkashi's full-sized avatar
💭
Working with machines against the machine

A.K. arashkashi

💭
Working with machines against the machine
View GitHub Profile
@arashkashi
arashkashi / mapping.swift
Last active July 27, 2016 12:08
maps a range of input to a range of output
import Cocoa
var str = "Hello, playground"
typealias LinearEquation = Double -> Double
func getLinearEquation(inp: (min: Double, max: Double),
out: (min: Double, max: Double)) -> LinearEquation {
let m = (out.max - out.min) / (inp.max - inp.min)
#!/bin/bash
HEAD_HASH=$(git rev-parse HEAD)
TAGS=$(git tag)
RESULT_FILE_NAME=""
for tag in $TAGS
do
TAG_COMMIT_HASH=$(git rev-list -n 1 $tag)
//: Playground - noun: a place where people can play
import UIKit
var str = "Hello, playground"
struct Token {
var value: String
//
// LocationManager.swift
// ths
//
// Created by Arash K. on 22/02/15.
// Copyright (c) 2015 Arash K. All rights reserved.
//
import Foundation
import CoreLocation
@arashkashi
arashkashi / AnchorEdges.swift
Created October 7, 2016 15:11
Anchor Edges
extension UIView {
func anchorEdges(toSuperView: UIView) {
self.topAnchor.constraintEqualToAnchor(toSuperView.topAnchor).active = true
self.bottomAnchor.constraintEqualToAnchor(toSuperView.bottomAnchor).active = true
self.leftAnchor.constraintEqualToAnchor(toSuperView.leftAnchor).active = true
self.rightAnchor.constraintEqualToAnchor(toSuperView.rightAnchor).active = true
}
}
//
// ScrollableStackedViewController.swift
// StackView
//
// Created by Arash Kashi on 10/7/16.
// Copyright © 2016 Arash Kashi. All rights reserved.
//
import Foundation
import UIKit
@arashkashi
arashkashi / uniformelyspacedLabels.swift
Created January 2, 2017 17:12
three uniformly spaced labels
//
// MyView.swift
// TestPopover
//
// Created by Arash Kashi on 1/2/17.
// Copyright © 2017 Arash Kashi. All rights reserved.
//
import Foundation
import UIKit
@arashkashi
arashkashi / ViewWithXib.swift
Last active July 15, 2019 16:00
IBDesignable UIView requirements.
//
// DesignableView.swift
// Views
//
// Created by Arash Kashi on 2017-12-05.
// Copyright © 2017 Arash Kashi. All rights reserved.
//
import Foundation
import UIKit
@arashkashi
arashkashi / LocationManager.swift
Created January 12, 2017 15:55
Location manager get the location from the iOS device GPS
//
// LocationManager.swift
// Kirina
//
// Created by Arash K. on 22/02/15.
// Copyright (c) 2015 Arash K. All rights reserved.
//
import Foundation
import CoreLocation
@arashkashi
arashkashi / CollectionViewDataSource.swift
Created February 24, 2017 13:02 — forked from andymatuschak/CollectionViewDataSource.swift
Type-safe value-oriented collection view data source
//
// CollectionViewDataSource.swift
// Khan Academy
//
// Created by Andy Matuschak on 10/14/14.
// Copyright (c) 2014 Khan Academy. All rights reserved.
//
import UIKit