- с утра посвизлил - весь день свободен
- украл, посвиззлил - в тюрьму
- волков бояться - в лесу не свиззлить
- не все золото что свиззлит
- свиззлинг - всему голова
- и рыбку съесть, и посвиззлить
- в большой семье свиззлом не щелкают
// | |
// Storage.swift | |
// | |
// Created by Grigory Avdyushin on 30.06.16. | |
// Copyright © 2016 Grigory Avdyushin. All rights reserved. | |
// | |
import UIKit | |
import CoreData |
import Foundation | |
// Compressing and decompressing a UUID to 22 characters via base64. | |
// Works great as a Swift playground. These articles were helpful: | |
// http://blog.codinghorror.com/equipping-our-ascii-armor/ | |
// http://69.195.124.60/~jasondoh/2013/08/14/creating-a-short-guid-in-objective-c/ | |
let identifier = NSUUID().uuidString | |
let base64TailBuffer = "=" |
UIFont: family Thonburi | |
UIFont: font Thonburi-Bold | |
UIFont: font Thonburi | |
UIFont: font Thonburi-Light | |
UIFont: family Khmer Sangam MN | |
UIFont: font KhmerSangamMN | |
UIFont: family Snell Roundhand | |
UIFont: font SnellRoundhand-Black | |
UIFont: font SnellRoundhand-Bold | |
UIFont: font SnellRoundhand |
import CoreGraphics | |
import Foundation | |
import UIKit | |
class GradientLabel : UILabel { | |
let gradient: CGGradient! | |
let alignedToSuperview: Bool! |
Say you're running a virtual machine on your work computer. Say this machine, for whatever reason, can only connect to the internet over NAT - as in, it does not get it's own IP address. Say this VM is running a webserver, and you need a device outside of your computer to connect to it.
If only there was a way to get your work computer to 'share' it's network, so that you could get at that VM… Here's how you do it!
For all instructions, I assume your work computer is a mac
Latency Comparison Numbers | |
-------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
Note: This is an older post that I did back when I thought I might have time to be a blogger. Oh I was oh so wrong. However, it has proven useful for some folks on stackoverflow. Thus I'm keeping it alive here on Gist.
One of my past projects dealt heavily with an open source Apple technology called HTTP Live Streaming. It’s an HTTP based streaming protocol that at its most fundamental level provides a way to stream video and audio from just about any server with nothing but a few free software tools provided by Apple**. However, it has a few additional features that I think make it a really exciting tool. Yet, I haven’t seen HTTP Live Streaming used very much. This is probably mainly due to the combination of a lack of good/clear documentation, and Apple’s Live Streaming Developer Tools being command line based also make the barrier to entry higher than many developers want to deal with.
The hope is to share my understanding of how to use this technology to:
extension ViewController: UISearchControllerDelegate { | |
func willPresentSearchController(searchController: UISearchController) { | |
tabBarController?.tabBar.hidden = true | |
searchBarBackground(true) | |
dimmingBackground(true) | |
} | |
func willDismissSearchController(searchController: UISearchController) { | |
tabBarController?.tabBar.hidden = false | |
searchBarBackground(false) |
A common task when developing iOS apps is to register custom cell subclasses for both UITableView
and UICollectionView
. Well, that is if you don’t use Storyboards, of course.
Both UITableView
and UICollectionView
offer a similar API to register custom cell classes:
public func registerClass(cellClass: AnyClass?, forCellWithReuseIdentifier identifier: String)
public func registerNib(nib: UINib?, forCellWithReuseIdentifier identifier: String)