Skip to content

Instantly share code, notes, and snippets.

@mikefogg
mikefogg / ImageToBase64.h
Created June 28, 2018 13:56
React Native NativeModue for turning HEIC images (or any image in the asset-library directory) into JPEG base64 encoded data
//
// ImageToBase64.h
//
// Created by Mike Fogg on 6/28/18.
//
#import <React/RCTBridgeModule.h>
#import <UIKit/UIKit.h>
#import <Photos/Photos.h>
ID,Quantity
6e5491e7-7f15-417d-a403-345,50.00000000
@mikefogg
mikefogg / gist:c3d75c5ce6c3d32b4727
Created October 24, 2014 16:20
Titanium TiDraggable BubbleParent Issue: app.js
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
// create tab group
var tabGroup = Titanium.UI.createTabGroup();
// Load Draggable
var Draggable = require('ti.draggable');
// this file located in /Library/Application Support/Titanium/mobilesdk/osx/{version_number}
// add the following methods to GeolocationModule.mm
- (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region
{
NSDictionary *event = [NSDictionary dictionaryWithObjectsAndKeys:NUMBOOL(YES),@"success",[NSDictionary dictionaryWithObjectsAndKeys:NUMDOUBLE(region.center.latitude),@"lat",NUMDOUBLE(region.center.longitude),@"lng",NUMDOUBLE(region.radius),@"radius",region.identifier,@"identifier",nil],@"region",nil];
if ([self _hasListeners:@"enteredRegion"])
{
[self fireEvent:@"enteredRegion" withObject:event];