Skip to content

Instantly share code, notes, and snippets.

View jtremback's full-sized avatar

Jehan jtremback

  • Bay Area
View GitHub Profile
@jtremback
jtremback / gist:e5dde527da9bcd69536e
Last active December 6, 2024 02:03
Add GPS metadata, stop stripping camera metadata
#import "RCTCameraManager.h"
#import "RCTCamera.h"
#import "RCTBridge.h"
#import "RCTEventDispatcher.h"
#import "RCTUtils.h"
#import "RCTLog.h"
#import "UIView+React.h"
#import <AssetsLibrary/ALAssetsLibrary.h>
#import <AVFoundation/AVFoundation.h>
#import <ImageIO/ImageIO.h>
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
/home/ubuntu/deepdream/dream.ipynb in <module>()
23 {
24 "cell_type": "code",
---> 25 "execution_count": null,
26 "metadata": {
27 "collapsed": true
NameError: name 'null' is not defined
@jtremback
jtremback / gist:50cf75604c9e5c55db49
Created July 7, 2015 02:55
UIImage metadata strip
// Saved as NSData
kMDItemAperture = 2.52606882168926
kMDItemBitsPerSample = 32
kMDItemColorSpace = "RGB"
kMDItemContentCreationDate = 2015-07-07 02:18:12 +0000
kMDItemContentModificationDate = 2015-07-07 02:18:12 +0000
kMDItemContentType = "public.jpeg"
kMDItemContentTypeTree = (
"public.jpeg",
@jtremback
jtremback / gist:b4996f4e884f4ce0748e
Last active August 29, 2015 14:24
quick and dirty mod of react-native-camera
#import "RCTCameraManager.h"
#import "RCTCamera.h"
#import "RCTBridge.h"
#import "RCTEventDispatcher.h"
#import "RCTUtils.h"
#import "RCTLog.h"
#import "UIView+React.h"
#import <AssetsLibrary/ALAssetsLibrary.h>
#import <AVFoundation/AVFoundation.h>
#import <ImageIO/ImageIO.h>
@jtremback
jtremback / gist:7be76c2816edf48df3b7
Created June 19, 2015 22:46
Persistent store- bad idea actually
class PersistentStore extends Store {
handle (state, type, payload) {
const newState = super.handle(state, type, payload)
this.setItem(this.key, newState.toJS())
return newState
}
async setPersistedStateAsync (reactor) {
debugger
const persistedState = await this._getPersistedStateAsync()
error-guard.js:79Error:
stack: ReferenceError: process is not defined
at keyMirror (http://localhost:8081/index.ios.bundle:14027:21)
at http://localhost:8081/index.ios.bundle:13934:25
at require (http://localhost:8081/index.ios.bundle:245:25)
at http://localhost:8081/index.ios.bundle:13714:22
at require (http://localhost:8081/index.ios.bundle:245:25)
at http://localhost:8081/index.ios.bundle:13567:24
at require (http://localhost:8081/index.ios.bundle:245:25)
at http://localhost:8081/index.ios.bundle:13487:47
@jtremback
jtremback / gist:55367f74b82e34f639ba
Last active August 29, 2015 14:22
es6 to commonJS module regexes
export function (.*?) \((.*)\)
exports.\1 = \1\nfunction \1(\2)
import \* as (\w*) from ('.*')
var \1 = require(\2)
import (\{(.|\n)*?default as (.*)\}) from (.*)
var \3 = require(\4)\nvar \1 = \3
\n *default as (.*)
'use strict';
var pull = require('pull-stream')
var net = require('net')
var toStream = require('pull-stream-to-stream')
var rimraf = require('rimraf')
rimraf.sync('./following1.db') // delete the db from last time
var ssb1 = require('../create')('./following1.db')
var feed1 = ssb1.createFeed()
@jtremback
jtremback / gist:cfaa53aa0376032982af
Created October 26, 2014 01:25
Don't understand why this doesn't work
'use strict';
var pull = require('pull-stream')
var net = require('net')
var toStream = require('pull-stream-to-stream')
var rimraf = require('rimraf')
rimraf.sync('./following1.db') // delete the db from last time
var ssb1 = require('../create')('./following1.db')
var feed1 = ssb1.createFeed()
@jtremback
jtremback / gist:1eaece0807fa3fe02262
Last active August 29, 2015 14:06
Meteor attempts
// 'use strict';
// An app that has items and stories.
// Items have properties: name, weight, description.
// Stories have properties: title, content, item
// Stories contain a widget for their item
// The add item screen shows this widget, live updating with a binding to the form.
// The same widget template code being used on both screens.
// Screens: story detail, add/edit story, add/edit item
var counterA = 0;