This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Sample React Native App | |
* https://github.com/facebook/react-native | |
* @flow | |
*/ | |
import React, { Component } from 'react'; | |
import { | |
AppRegistry, | |
StyleSheet, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Old | |
[latStr, lngStr] = String.split(geo, ",") | |
{lat, _} = Float.parse(latStr) | |
{lng, _} = Float.parse(lngStr) | |
[bl, tr] = Geocalc.bounding_box([lat,lng], 10_000) | |
[lat1, lng1] = bl; | |
[lat2, lng2] = tr; | |
coords = "#{lat1}, #{lng1}, #{lat2}, #{lng2}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# elixir | |
{:ok, pid} = Mongo.start(database: "test") | |
coll = "tags" | |
pipeline = [ | |
%{'$project': %{ 'b': %{ '$in': ["b", ["a", "b", "c"]] } }}, | |
%{'$match': %{ 'b': true }}, | |
%{'$project': %{ 'b': 0 }} | |
] | |
Mongo.aggregate(pid, coll, pipeline) |> Enum.to_list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
CURRENT_NAME="CurentName" | |
CURRENT_OTP="current_name" | |
NEW_NAME="NewName" | |
NEW_OTP="new_name" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Small helper to split an array into groups of various size | |
* | |
* Usage: | |
* group([1, 2, 3, 4, 5], 2) # -> [[1, 2], [3, 4], [5]] | |
* group([1, 2, 3, 4], 5) # -> [[1, 2, 3, 4]] | |
**/ | |
let group = (arr, numPerGroup) => { | |
if (arr.length <= 0) return []; | |
let groups = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { | |
Text, | |
View, | |
TouchableOpacity, | |
ActivityIndicator, | |
Navigator | |
} from 'react-native'; | |
import {GoogleSignin} from 'react-native-google-signin'; | |
import Firestack from 'react-native-firestack' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { Provider } from 'react-redux' | |
import { AppRegistry } from 'react-native'; | |
import App from './containers/App' | |
import { | |
configureStore | |
} from './redux/configureStore' | |
const {store, actions} = configureStore(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* A small wrapper to turn a prototype, callback object | |
* to a chainable api using promises. | |
* | |
* Usage: | |
* var Klass = function() {} | |
* Klass.prototype.log = function(msg, cb) { | |
* console.log(msg); | |
* cb(); | |
* } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// config/development.js | |
module.exports = { | |
NAME: 'FirestackDemo.dev', | |
firestack: { | |
apiKey: "XXXXXXXX", | |
authDomain: "your-auth-domain.firebaseapp.com", | |
databaseURL: "https://your-database-url.firebaseio.com", | |
storageBucket: "your-storage-bucket.appspot.com", | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {createConstants, createReducer} from 'redux-module-builder' | |
import {createApiHandler, createApiAction} from 'redux-module-builder/api' | |
/* | |
* Constants | |
* | |
* Basic constants can just be a name | |
* i.e. 'GET_ME' | |
* and api constants can be an Object | |
* i.e. { 'GET_UPCOMING': { api: true }} |