Skip to content

Instantly share code, notes, and snippets.

View gblazex's full-sized avatar

Blaze (Balázs Galambosi) gblazex

View GitHub Profile
//
// NSObject+BlockObservation.h
// Version 1.0
//
// Andy Matuschak
// andy@andymatuschak.org
// Public domain because I love you. Let me know how you use it.
//
#import <Cocoa/Cocoa.h>
@gblazex
gblazex / wwdc15.md
Last active August 29, 2015 14:24 — forked from mackuba/wwdc15.md

Here's my own list of the interesting stuff announced during this year's WWDC, collected from the keynotes, various Apple docs, blog posts and tweets.

If you're planning to watch the videos, I really recommend this Mac app that helps you download and watch them: https://github.com/insidegui/WWDC.

OS X El Capitan

http://www.apple.com/osx/elcapitan-preview/

  • split view - two apps side by side on full screen
//
// NSArray+IndexHelper.h
// C_POS
//
// Created by Tomohisa Takaoka on 6/14/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
/*
* This is an example provided by Facebook are for non-commercial testing and
* evaluation purposes only.
*
* Facebook reserves all rights not expressly granted.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
@gblazex
gblazex / memoize
Last active August 29, 2015 14:02
// JavaScript
function memoize(fn) {
var memo = {}
return function(x) {
return memo[x] || (memo[x] = fn(x))
}
}
// Swift
func memoize<T: Hashable, U>( body: ((T)->U, T)->U ) -> (T)->U {
function fixDevTools() {
Element.prototype.enableStyleClass = function(){}
var oldToggle = DOMTokenList.prototype.toggle;
DOMTokenList.prototype.toggle = function(c) {
if ('offscreen' == c) return;
oldToggle.apply(this, arguments);
}
IMPORTANT
Please duplicate this radar for a Safari fix!
This will clean up a 50-line workaround.
rdar://22376037 (https://openradar.appspot.com/radar?id=4965070979203072)
//////////////////////////////////////////////////////////////////////////////
(Now available as a standalone repo.)