Skip to content

Instantly share code, notes, and snippets.

View romainbriche's full-sized avatar

Romain Briche romainbriche

View GitHub Profile
@romainbriche
romainbriche / IPInsetLabel.h
Created May 7, 2012 08:14
IPInsetLabel: a simple UILabel subclass that adds padding insets and auto-height-resizing
//
// IPInsetLabel.h
// Instapaper
//
// Created by Marco Arment on 7/23/11.
// Copyright 2011 Instapaper LLC, released to the public domain.
//
#import <UIKit/UIKit.h>
//
// NSObject+setValuesForKeysWithJSONDictionary.h
// SafeSetDemo
//
// Created by Tom Harrington on 12/29/11.
// Copyright (c) 2011 Atomic Bird, LLC. All rights reserved.
//
#import <Foundation/Foundation.h>
/*
Copyright 2011 Martin Hawksey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
ACTION = build
AD_HOC_CODE_SIGNING_ALLOWED = NO
ALTERNATE_GROUP = staff
ALTERNATE_MODE = u+w,go-w,a+rX
ALTERNATE_OWNER = grantdavis
ALWAYS_SEARCH_USER_PATHS = NO
ALWAYS_USE_SEPARATE_HEADERMAPS = YES
APPLE_INTERNAL_DEVELOPER_DIR = /AppleInternal/Developer
APPLE_INTERNAL_DIR = /AppleInternal
APPLE_INTERNAL_DOCUMENTATION_DIR = /AppleInternal/Documentation
@romainbriche
romainbriche / AZModel.h
Created July 19, 2012 12:35
Thread-safe NSManagedObjectContext factory.
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
@interface AZModel : NSObject
+ (AZModel *)sharedModel;
- (__strong NSManagedObjectContext *)managedObjectContextForCurrentThread;
- (__autoreleasing NSManagedObjectContext *)newManagedObjectContextForCurrentThread;
@end
@romainbriche
romainbriche / EventEmitter.swift
Created October 24, 2017 11:12 — forked from brennanMKE/EventEmitter.swift
React Native Event Emitter for RCTEventEmitter in Objective-C and Swift
class EventEmitter
/// Shared Instance.
public static var sharedInstance = EventEmitter()
// ReactNativeEventEmitter is instantiated by React Native with the bridge.
private static var eventEmitter: ReactNativeEventEmitter!
private init() {}
# VERSION 1.0.4
# Author: @madhavajay
# This currently works for iOS and watchOS in the Simulator and Devices
# Changes
# Using ${TOOLCHAIN} in two places now
# Added double quotes " around paths
# Fixed watchOS Issues
# Instructions iOS
@romainbriche
romainbriche / build_opencv_ios.sh
Created October 25, 2017 08:43 — forked from benjohnde/build_opencv_ios.sh
Compilation error of dynamic framework for iOS (OpenCV 3.3.0)
#!/bin/bash
git clone git@github.com:opencv/opencv.git
cd opencv
git checkout 3.3.0
python platforms/ios/build_framework.py ios \
--dynamic \
--without imgcodec --without videoio --without video --without calib3d --without features2d \
--without objdetect --without dnn --without ml --without flann --without photo --without stitching \
--without cudaarithm --without cudabgsegm --without cudacodec --without cudafeatures2d \
--without cudafilters --without cudaimgproc --without cudalegacy --without cudaobjdetect \
@romainbriche
romainbriche / UIColorExtension.md
Created October 26, 2017 06:18 — forked from bhrott/UIColorExtension.md
Swift 3: Hex UIColor

Extension:

import Foundation
import UIKit

extension UIColor {
    convenience init(hexString: String) {
        let hex = hexString.trimmingCharacters(in: CharacterSet.alphanumerics.inverted)
        var int = UInt32()
 Scanner(string: hex).scanHexInt32(&amp;int)