Skip to content

Instantly share code, notes, and snippets.

View marty-suzuki's full-sized avatar
Back to the future

Taiki Suzuki marty-suzuki

Back to the future
View GitHub Profile
@inamiy
inamiy / reactiveswift.swift
Last active July 27, 2017 17:06
Rx "Hot -> Cold" + multiple subscription behavior
print("=== signal (hot) ===")
do {
let (signal, observer) = Signal<Int, NoError>.pipe()
let s = signal
.map { x -> Int in
print("map \(x)")
return x
}
s.observeValues { _ in }
@inamiy
inamiy / swift-instance-method-retain-cycle-behavior.swift
Created June 15, 2017 03:37
Swift instance-method retain cycle behavior
import Foundation
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
class A: NSObject {
let name: String
var callback: (() -> ())?
func funcDo() {}
@ukitaka
ukitaka / convert_to_srgb.md
Created February 9, 2017 10:13
Storyboardとxibのcolor spaceをsRGBに統一する

calibratedRGB → sRGB

% find . -name "*.storyboard" | xargs sed -i "" '-e s/colorSpace="calibratedRGB"/colorSpace="custom" customColorSpace="sRGB"/g'
% find . -name "*.xib" | xargs sed -i "" '-e s/colorSpace="calibratedRGB"/colorSpace="custom" customColorSpace="sRGB"/g'

calibratedWhite → sRGB

@stuartjmoore
stuartjmoore / WPTextAttachment.h
Last active October 21, 2016 13:08
Creates an NSTextAttachment the takes up the entire width of the line fragment (while maintaining its aspect ratio). Instead of a simple image, any UIView (that has a (CGFloat)heightThatFits method) will work.
//
// WPTextAttachment.h
// ReadArticle
//
// Created by Moore, Stuart on 12/27/13.
// Copyright (c) 2013 The Washington Post. All rights reserved.
//
#import <UIKit/UIKit.h>
ACTION
AD_HOC_CODE_SIGNING_ALLOWED
ALTERNATE_GROUP
ALTERNATE_MODE
ALTERNATE_OWNER
ALWAYS_SEARCH_USER_PATHS
ALWAYS_USE_SEPARATE_HEADERMAPS
APPLE_INTERNAL_DEVELOPER_DIR
APPLE_INTERNAL_DIR
APPLE_INTERNAL_DOCUMENTATION_DIR