Skip to content

Instantly share code, notes, and snippets.

View jamielob's full-sized avatar

Jamie Loberman jamielob

View GitHub Profile
import React, { Component, PropTypes } from 'react'
import {
Text,
View,
TouchableHighlight,
ScrollView,
StatusBar,
Dimensions,
Animated
@machadogj
machadogj / picker.js
Created March 17, 2016 20:18
React native simple picker
"use strict";
import React from "react-native";
let {
StyleSheet,
View,
ScrollView,
PropTypes,
Component,
Text
@cmcewen
cmcewen / upload.js
Created December 29, 2015 15:38
Upload image from React Native to Cloudinary
var CryptoJS = require('crypto-js');
function uploadImage(uri) {
let timestamp = (Date.now() / 1000 | 0).toString();
let api_key = 'your api key'
let api_secret = 'your api secret'
let cloud = 'your cloud name'
let hash_string = 'timestamp=' + timestamp + api_secret
let signature = CryptoJS.SHA1(hash_string).toString();
let upload_url = 'https://api.cloudinary.com/v1_1/' + cloud + '/image/upload'
@jamielob
jamielob / Meteor IOS facebook login guide.markdown
Last active April 8, 2017 19:54
Meteor cordova ios facebook login

How to get facebook login working with Meteor and Cordova on iOS

Step 1: Make your local dev site internet accessible

Because there is an issue with OAuth2 login and localhost development, you currently have to deploy your meteor site to be able to test the Facebook login. A nice little workaround for this is to make the local instance of meteor accessible externally.

There is a great online guide for setting up port forwarding with your router and you can check your public external IP here.

For example, If you have an Apple router, simply open up Airport Utility on your Mac and click edit on your router, then go to the Network tab. Under Port Settings click the + icon and select Personal Web Sharing, setting all of the public and private ports to 3000. Make sure the private IP is set to your current computer IP.

@marioblas
marioblas / add-attributes.js
Last active December 21, 2017 17:41
Underscore.js - Add attributes to each object of an array
/**
* Add attributes to each object of an array.
*
* @param {array} foo - Array of objects where we will add the attibutes
* @param {function} iterator
*/
_.each(foo, function(element, index) {
_.extend(element, {field1: index}, {field2: 'bar', field3: 'baz'});
});
@cullymason
cullymason / Laravel_Ember.md
Last active December 20, 2015 21:38
It would be nice if we had a plugin that allows Laravel to play nice with Ember. Put simply I would like to create an easy way for Laravel to output JSON strings in a way that Ember likes.

Basic Explaination

It would be nice if we had a plugin that allows Laravel to play nice with Ember. Put simply I would like to create an easy way for Laravel to output JSON strings in a way that Ember likes.

What Laravel Does

return Model::find($id);