Skip to content

Instantly share code, notes, and snippets.

@kishikawakatsumi
kishikawakatsumi / Rakefile
Last active August 29, 2015 13:56
Rakefile for testing, building and uploading to Testflight/Crittercism
require "rubygems/version"
require "rake/clean"
require "date"
require 'time'
require "json"
require "open3"
# Application info
APP_NAME = "Ubiregi2"
SDK = "iphoneos"
@radex
radex / wwdc2015.md
Last active August 29, 2015 14:22
WWDC (iOS 9, OS X 10.11, Swift 2.0, Xcode 7) hopes&wishes

iOS 9:

  1. Stability, stability, stability. Things should just work. Especially networking/cloud related stuff: AirDrop, Handoff, syncing, etc…
  2. Notification center that's actually useful. Instead of grouping them by apps, and failing to intelligently show the notifications I'm interested in, show the chronological stream/feed of all notifications. Don't remove anything from that feed, only gray out notifications you've tapped on/seen. So, just like Facebook notifications. Much better model.
  3. Presence awareness for more intelligent notifications. Don't give me the cacophony of notifications of all 4 devices. Devices within each other's BTLE range should have awareness of each other and know that if I'm actively using my Mac, I want notifications to only show up there.
  4. Better app folders. The 3x3 grid is bullshit design, and even worse on the iPad. Make the folder zoom in and expand into a scrolling list of apps, not a paged interface. Kinda like on the Mac
  5. Allow people to choose default a
@kishikawakatsumi
kishikawakatsumi / main.m
Created January 14, 2014 18:52
One-line fix for UITextView on iOS 7
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char * argv[])
{
@autoreleasepool {
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"UIDisableLegacyTextView"];
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
//: Playground - noun: a place where people can play
import Cocoa
// When you’re downloading objects from the web, it’s common to need to merge changes
// from the server to already-existing local objects. (If your data model allows for
// mutable objects, as with Core Data, that is.)
//
// The below is a Swift translation of how I’ve done this in Objective-C.
// Note that it works just fine in Swift — though it does require NSObject subclasses.
/// An indexed tuple specifically for use with enumerated results
public typealias Indexed<Index, Value> = (index: Index, value: Value)
public extension Array {
/// Establishes a lazy sequence of enumerated items using index and value labels
public func indexed() -> LazyMapSequence<EnumeratedSequence<[Element]>, Indexed<Index, Element>> {
return enumerated()
.lazy
.map({ return $0 as Indexed<Index, Element> })

VimConf 2016 ujihisa感想記事

2016-11-05に日本の東京のmixi, Inc.で開催されたVimConf2016に参加してきました。

ujihisa.vimとそれに続く4回のVimConfのうち、今回はじめて発表者でなく一般客として参加しました。正確には当日スタッフとして受付を担当しました。今回はじめて参加費を払うことに成功しました。 (*1)

発表内容

後述する受付的理由で、一部の発表は注意深く視聴する機会を逃した関係で、一部の発表にたいしてのみコメントします。

@mala
mala / gist:fad5e0bc8a82a9c0fc9d
Last active December 29, 2016 18:02
AFNetworking 2.5.2 以下の脆弱性について

未修正のアプリが数多く残っている状態なので、パブリックな場所での言及には注意して下さい

未修正のアプリが数多く残っている状況ですが、すでに広く情報が公開されており、2.5.2で修正されたという情報が広まると混乱が生じるため広く周知する次第です。

問題と経緯

AFNetworking 2.5.1 にMITM攻撃を許す脆弱性があり、2.5.2で修正された、 と報道されていますが、これは誤りです。

@airspeedswift
airspeedswift / mergesort.swift
Last active January 3, 2017 05:04
Swift 3 Merge Sort
extension RangeReplaceableCollection
where
// Index: RandomAccessIndexType → Self: RandomAccessCollection
Self: RandomAccessCollection,
// still need this, until generics allow constraints to guarantee
// this is the case for all collections...
SubSequence.Iterator.Element == Iterator.Element {
// mutating in-place operations should be imperative verb phrases,
// so let's rename this stablySort
@krzysztofzablocki
krzysztofzablocki / template.stencil
Last active January 14, 2017 15:22
AutoEquatable template
// swiftlint:disable file_length
fileprivate func compareOptionals<T>(lhs: T?, rhs: T?, compare: (_ lhs: T, _ rhs: T) -> Bool) -> Bool {
switch (lhs, rhs) {
case let (lValue?, rValue?):
return compare(lValue, rValue)
case (nil, nil):
return true
default:
return false

Lightning talk on ATP episode 205

Caution - Ahead be spoilers!!

  1. John, Casey and Marco
  2. Chris Lattner is on the show. Creator of LLVM and Swift. Now working at Tesla on automotive software (he later calls it autopilot, so ¯_(ツ)_/¯
  3. LLVM is a collection of compiler infrastructure projects.
  4. Ex: SourceKit leverages LLVM (rather than a monolith, access underlying services)
  5. LLVM first used in  OpenGL stuff to repack buffers for various GPUs. Code gen stuff. llvm bytecode files -> GPU machine code 😳