Skip to content

Instantly share code, notes, and snippets.

View rafcio2k's full-sized avatar

Rafał Baranowski rafcio2k

  • 17:28 (UTC +02:00)
View GitHub Profile
@M0rtyMerr
M0rtyMerr / combine_vs_RxSwift_perfomance.swift
Last active April 22, 2024 07:48
Combine vs RxSwift perfomance
import XCTest
import Combine
import RxSwift
final class PlaygroundTests: XCTestCase {
private let input = stride(from: 0, to: 10_000_000, by: 1)
override class var defaultPerformanceMetrics: [XCTPerformanceMetric] {
return [
XCTPerformanceMetric("com.apple.XCTPerformanceMetric_TransientHeapAllocationsKilobytes"),
@solancer
solancer / Install Ruby Gems on Mac OS X without sudo
Created January 3, 2017 15:21
Install Ruby Gems on Mac OS X without sudo
Install Ruby Gems on Mac OS X without sudo
1. Add GEM_HOME to your .bash_profile
For example, nano ~/.bash_profile and add
export GEM_HOME=/Users/srinivas/.gem where the path is to your own Home folder
2. Add the gem executables to your system path
Also in .bash_profile, add
@topas
topas / CancelableNavigationController.swift
Last active October 21, 2022 06:25
UINavigationController with cancellable swipe back (left) gesture
import UIKit
protocol SwipeBackDelegate: class {
func shouldSwipeBackStarted(point: CGPoint) -> Bool
func swipeBackFinished() -> Bool
func swipeBackNotFinished()
}
class CancelableNavigationController: UINavigationController, UIGestureRecognizerDelegate, UINavigationControllerDelegate {
@AlamofireSoftwareFoundation
AlamofireSoftwareFoundation / alamofire-04-27-2015-statement.md
Last active January 10, 2020 06:25
A response to recent concerns about security vulnerabilities in AFNetworking

Last week, a number of publications ran a story about 1,000's of apps allegedly being vulnerable due to an SSL bug in AFNetworking. These articles contain a number of inaccurate and misleading statements on this matter.

We are publishing this response to clarify and correct these statements.

Background Information

For those not familiar with AFNetworking, here are some relevant details about the library for this story:

  • AFNetworking is an open source, third-party library that provides convenience functionality on top of Apple's built-in frameworks.
  • One component of AFNetworking is AFSecurityPolicy, which handles authentication challenges according to a policy configured by the application. This includes the evaluation of X.509 certificates which servers send back when connecting over HTTPS.
@odrobnik
odrobnik / gist:9c5ec3b54eedf254d916
Created November 5, 2014 20:17
Workaround for iPhone 6+ horizontal size class bug (when using "present as popover" initial show comes with compact class, only after rotation it is correctly regular)
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
// workaround for iPhone 6+ bug
if (self.traitCollection.displayScale==3)
{
CGSize windowSize = [UIScreen mainScreen].bounds.size;
CGSize viewSize = self.view.bounds.size;
@maciekish
maciekish / UINavigationBar+CustomHeight.h
Created September 10, 2014 08:48
Custom UINavigationBar height working in iOS 7 and 8. To use, find your navigation bar reference and just setHeight:200 etc.
//
// UINavigationBar+CustomHeight.h
//
// Copyright (c) 2014 Maciej Swic
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@oliverbarreto
oliverbarreto / PulseView.m
Created December 27, 2013 16:23
Creates PulseView with a circle pulse (color and size of circle)
//
// DOBRPulseView.m
// test2
//
// Created by David Oliver Barreto Rodríguez on 27/12/13.
// Copyright (c) 2013 David Oliver Barreto Rodríguez. All rights reserved.
//
// This is much simpler if you don't draw the circle in drawRect:. Instead, set up your view to use a CAShapeLayer, like this:
#import "DOBRPulseView.h"
@lexrus
lexrus / HD.txt
Last active July 20, 2023 08:11
All WWDC 2013 Session Videos URLs in https://developer.apple.com/wwdc/videos/ dumped with Chrome. You can download these videos **without** a Apple developer account by running the download.sh script. There is also a sample code downloader here: https://github.com/jfahrenkrug/WWDC-Downloader
http://devstreaming.apple.com/videos/wwdc/2013/710xfx3xn8197k4i9s2rvyb/710/710-HD.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2013/202xdx2x47ezp1wein/202/202-HD.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2013/200xdx2x35e1pxiinm/200/200-HD.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2013/413xdx5x97itb5ek4yex3r7/413/413-HD.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2013/612xax4xx65z1ervy5np1qb/612/612-HD.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2013/221xex4xxohbllf4hblyngt/221/221-HD.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2013/220xbx4xipaxfd1tggxuoib/220/220-HD.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2013/711xcx4x8yuutk8sady6t9f/711/711-HD.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2013/404xbx2xvp1eaaqonr8zokm/404/404-HD.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2013/505xbx4xrgmhwby4oiwkrpp/505/505-HD.mov?dl=1
@mattt
mattt / uiappearance-selector.md
Last active June 4, 2024 13:28
A list of methods and properties conforming to `UIAppearance` as of iOS 12 Beta 3

Generate the list yourself:

$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep UI_APPEARANCE_SELECTOR ./*     | \
  sed 's/NS_AVAILABLE_IOS(.*)//g'     | \
  sed 's/NS_DEPRECATED_IOS(.*)//g'    | \
  sed 's/API_AVAILABLE(.*)//g'        | \
  sed 's/API_UNAVAILABLE(.*)//g'      | \
 sed 's/UI_APPEARANCE_SELECTOR//g' | \
@roolo
roolo / .gitconfig
Created October 21, 2011 14:39
git-merge with KDiff3 on Mac OS X Lion
# This is file ~/.gitconfig
[merge]
tool = extMerge
[mergetool "extMerge"]
cmd = ~/bin/extMerge \"$BASE\" \"$LOCAL\" \"$REMOTE\" -o \"$MERGED\"