Skip to content

Instantly share code, notes, and snippets.

View flexaddicted's full-sized avatar

Lorenzo B. flexaddicted

View GitHub Profile
@miguelcma
miguelcma / DeviceUID.m
Created May 25, 2015 15:09
iOS Unique Device ID that persists between app reinstalls
/* DeviceUID.h
#import <Foundation/Foundation.h>
@interface DeviceUID : NSObject
+ (NSString *)uid;
@end
*/
// Device.m
@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.
@nolanlawson
nolanlawson / protips.js
Last active February 4, 2024 18:06
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
@ColinEberhardt
ColinEberhardt / gist:984907adbf8236077c1f
Last active June 15, 2016 23:22
Links from my talk at SwiftSummit
Silverlight and ReactiveExtensions article:
http://blog.scottlogic.com/2010/12/02/exploring-reactive-extensions-rx-through-twitter-and-bing-maps-mashups.html
My Ray Wenderlich author page, contains quite a few ReactiveCocoa and MVVM articles:
http://www.raywenderlich.com/u/ColinEberhardt
ObjC block syntax - say no more!
http://fuckingblocksyntax.com
Twitter app with sentiment analysis
@smileyborg
smileyborg / UIView+Orientation.h
Last active February 2, 2021 14:57
Migrating Rotation Code to iOS 8
//
// UIView+Orientation.h
//
#import <UIKit/UIKit.h>
// These macros should only be used if you MUST know the interface orientation for the device itself, for example when displaying a new UIWindow.
// This should be very rare; generally you should only look at the immediate parent view's size (or "view orientation" using the category below).
#define StatusBarOrientationIsPortrait UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation])
#define StatusBarOrientationIsLandscape UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation])
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active April 8, 2024 18:07
The best FRP iOS resources.

Videos

@ColinEberhardt
ColinEberhardt / Swift Events
Created February 11, 2015 09:15
An eventing mechanism for Swift
/// An object that has some tear-down logic
public protocol Disposable {
func dispose()
}
/// An event provides a mechanism for raising notifications, together with some
/// associated data. Multiple function handlers can be added, with each being invoked,
/// with the event data, when the event is raised.
public class Event<T> {
@interface PSPDFWindow ()
@property (nonatomic, strong) UIViewController *realRootViewController;
@end
@implementation PSPDFWindow
- (void)setHidden:(BOOL)hidden {
[super setHidden:hidden];
// Workaround for rdar://19592583
@0xced
0xced / copy-reveal-dylib.sh
Last active March 15, 2016 15:11
Copy and codesign libReveal.dylib in Debug configuration (for use in a run script build phase)
#!/bin/bash -e
if [ "${CONFIGURATION}" != "Debug" ]; then
exit 0
fi
REVEAL_APP_PATH=$(mdfind -onlyin / "kMDItemCFBundleIdentifier == com.ittybittyapps.Reveal" | head -n 1)
if [ ! -d "${REVEAL_APP_PATH}" ]; then
echo "warning: Reveal.app not found."
exit 0
@staltz
staltz / introrx.md
Last active May 3, 2024 13:00
The introduction to Reactive Programming you've been missing