Skip to content

Instantly share code, notes, and snippets.

View romainbriche's full-sized avatar

Romain Briche romainbriche

View GitHub Profile
@romainbriche
romainbriche / POD_NAME.podspec
Created December 14, 2017 06:59 — forked from phatblat/POD_NAME.podspec
POC of a Pod which installs a run script into Xcode (CocoaPods 0.33 or less)
Pod::Spec.new do |s|
s.name = 'POD_NAME'
s.version = '1.0.0'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.summary = 'Example of pod which installs a run script into the Xcode project (first target)'
s.homepage = 'https://github.com/phatblat/POD_NAME'
s.authors = { 'Ben Chatelain' => 'benchatelain@gmail.com' }
s.source = { :git => 'https://github.com/phatblat/POD_NAME.git', :tag => s.version.to_s }
s.ios.deployment_target = '6.0'
@romainbriche
romainbriche / shopify.md
Created November 29, 2017 13:22 — forked from lambtron/shopify.md
segment event tracking for shopify
title sidebar
Segment Event Tracking for Shopify
Shopify

Segment makes it simple for Shopify merchants to integrate analytics, email marketing, advertising and optimization tools. Rather than installing all your tools individually, you just install Segment once. We collect your data, translate it, and route it to any tool you want to use with the flick of a switch. Using Segment as the single platform to manage and install your third-party services will save you time and money.

The guide below explains how to install Segment in your Shopify store. All you need to get up and running is copy and paste a few snippets of code into your theme editor. (You don't have to edit the code or be versed in JavaScript.) The following guide will show you how, step by step.


@romainbriche
romainbriche / NSNotificationCenterExtensions.swift
Created November 3, 2017 21:50 — forked from Rich86man/NSNotificationCenterExtensions.swift
NSNotificationCenter extension for safe Swift instance method support
/*
Copyright (c) 2011-present, NimbusKit. All rights reserved.
This source code is licensed under the BSD-style license found at http://nimbuskit.info/license
Extracted from NimbusKit: Swift Edition at https://github.com/nimbuskit/swift
*/
extension NSNotificationCenter {
/**
@romainbriche
romainbriche / generateRandomColor.swift
Created October 31, 2017 13:49 — forked from asarode/generateRandomColor.swift
Generating random UIColor in Swift
func generateRandomColor() -> UIColor {
let hue : CGFloat = CGFloat(arc4random() % 256) / 256 // use 256 to get full range from 0.0 to 1.0
let saturation : CGFloat = CGFloat(arc4random() % 128) / 256 + 0.5 // from 0.5 to 1.0 to stay away from white
let brightness : CGFloat = CGFloat(arc4random() % 128) / 256 + 0.5 // from 0.5 to 1.0 to stay away from black
return UIColor(hue: hue, saturation: saturation, brightness: brightness, alpha: 1)
}
@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(&int)
@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 \
# 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 / 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() {}
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