Skip to content

Instantly share code, notes, and snippets.

🚀
Launching my iOS app Banner Hunter

Kuba Suder mackuba

🚀
Launching my iOS app Banner Hunter
Block or report user

Report or block mackuba

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mackuba
mackuba / log-exclude-bots.rb
Last active Feb 1, 2019
Scripts for processing Nginx logs for Piwik
View log-exclude-bots.rb
#!/usr/bin/env ruby
require 'optparse'
require 'set'
$buffer = []
$current_day = nil
$validated = Set.new
$invert = false
@mackuba
mackuba / macbook-pro-2016.md
Created Jan 18, 2017
MacBook Pro 2016 - an iOS developer's review
View macbook-pro-2016.md

MacBook Pro 2016 - an iOS developer's review

Here are some thoughts about my new MacBook Pro that I've been using for the last few weeks (the Santa Claus from DHL brought it to me just before Christmas), hopefully this will help someone who's considering getting one.

Note: this is written from the perspective of a person who switched to the MBP from a 2015 13" MacBook Air (i7) and also has a 2012 21" iMac. Your experiences will obviously be different if you have e.g. a fairly recent 15" Retina MacBook Pro.

Specs

  • MacBook Pro 15", late 2016
  • Core i7 2.9 GHz (4 cores)
@mackuba
mackuba / wwdc16.md
Last active Feb 10, 2019
New stuff from WWDC 2016
View wwdc16.md

Following the tradition from last year, here's my complete list of all interesting features and updates I could find in Apple's OSes, SDKs and developer tools that were announced at this year's WWDC. This is based on the keynotes, the "What's New In ..." presentations and some others, Apple's release notes, and blog posts and tweets that I came across in the last few weeks.

If for some reason you haven't watched the talks yet, I really recommend watching at least the "State of the Union" and the "What's New In" intros for the platforms you're interested in. The unofficial WWDC Mac app is great way to download the videos and keep track of what you've already watched.

If you're interested, here are my WWDC 2015 notes (might be useful if you're planning to drop support for iOS 8 now and start using some iOS 9 APIs).


OSX → macOS 10.12 Sierra

@mackuba
mackuba / content_blocker_tips.md
Last active Feb 25, 2019
Tips for writing iOS content blockers - HelsinkiOS
View content_blocker_tips.md
  • read this first: https://www.webkit.org/blog/3476/content-blockers-first-look/
  • start by adding a new extension target to your iOS app of type “content blocker”
  • launch the app using the main target’s scheme + a call to SFContentBlockerManager.reloadContentBlockerWithIdentifier() with the extension’s id in application:didFinishLaunchingWithOptions: to auto-reload the blocker in development mode
  • if you don’t call reloadContentBlockerWithIdentifier() then you need to switch the blocker off and on again in the Safari settings (stop the app in Xcode if the switch is not moving)
  • use inspector from desktop Safari to inspect the Safari in the simulator in order to find specific things to block
  • things like periods in the url-filter regexp need to be escaped with double backslashes, e.g. facebook\\.net
  • if you use if-domain, it needs to be an array, even for one element
  • domain foo.com might not match www.foo.com even though I think it’s supposed to (UPDATE: They've changed it in one of
@mackuba
mackuba / wwdc15.md
Last active Sep 17, 2019
New stuff from WWDC 2015
View 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
View wait-google-sent-me.js
var active = false;
function changeRefer(details) {
if (!active) return;
for (var i = 0; i < details.requestHeaders.length; ++i) {
if (details.requestHeaders[i].name === 'Referer') {
details.requestHeaders[i].value = 'http://www.google.com/';
break;
}
View wait-google-sent-me.js
var active = false;
function changeRefer(details) {
if (!active) return;
for (var i = 0; i < details.requestHeaders.length; ++i) {
if (details.requestHeaders[i].name === 'Referer') {
details.requestHeaders[i].value = 'http://www.google.com/';
break;
}
@mackuba
mackuba / MKAnnotationView-v1.swift
Last active Aug 17, 2016
Swift MKAnnotationView WTF
View MKAnnotationView-v1.swift
/*
MKAnnotationView has one init listed in its documentation, initWithAnnotation:reuseIdentifier:, so let's override that.
But this causes a runtime exception:
fatal error: use of unimplemented initializer 'init(frame:)' for class 'PulsatingDotMarker'
*/
class PulsatingDotMarker: MKAnnotationView {
let innerCircle: UIView
@mackuba
mackuba / swift_programming_language_b3.md
Last active Jun 11, 2016
I made a diff of the versions of Swift ebooks between the early June and early July versions. I'm not sure if I can post it publicly, but here's a summary of what's updated:
View swift_programming_language_b3.md
  • across all sections:

    • changed all occurrences of the a..b operator to a..<b
    • changed all occurrences of a Something[] array type to [Something]
    • changed some occurrences of an Array(values) array initialization to [Something](values)
    • changed some occurrences of a Dictionary<Key, Value> dictionary type to [Key: Value]
  • Swift Tour:

    • added a line:
@mackuba
mackuba / nsconference_2014.md
Last active Aug 29, 2015
Notes from NSConference 6 (Leicester, 2014)
View nsconference_2014.md

NSConference 6 notes

Day 1

How to lose at poker (Mike Lee, @bmf)

  • emotion/intuition vs. reason in cards - those who ultimately win are not those who follow their intuition and emotions, but those who resist the temptation to do that; e.g. an "inside straight" (5 6 x 8 9) is twice harder to complete than other straights (x 5 6 7 8 x) even though it feels just as likely, so it's reckless to try to get one
  • chance of failure is never 0%
  • it's not about winning all the time, it's about managing your wins in a sea of losses, and using your losses to your advantage
You can’t perform that action at this time.