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
#Analyze image | |
media = "https://i.ytimg.com/vi/DGU1awKrNiA/hqdefault.jpg" | |
params = { | |
"requests": | |
[ | |
{ | |
"features": | |
[ | |
{ "maxResults": 50, "type": "TEXT_DETECTION" }, | |
], |
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'; | |
let Current=null | |
class Proxy extends Component { | |
static navigationOptions = ({ navigation, navigationOptions }) => { | |
const { params } = navigation.state; | |
return { | |
title: params.title, | |
headerStyle: { backgroundColor: '#fff' }, |
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, View, ScrollView, Text } from 'react'; | |
import { createBottomTabNavigator, createStackNavigator, createAppContainer, StackActions, NavigationActions } from 'react-navigation'; | |
import { Constants } from 'react-native-unimodules' | |
import Splash from './../views/Splash.js' | |
import Login from './../views/Login.js' | |
import CodeConfirmation from './../views/CodeConfirmation.js' | |
import Share from './../views/Share.js' | |
import Content from './../views/Content.js' | |
import Main from './../views/Main.js' |
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 { FlatList, View, Text } from 'react-native'; | |
class List extends Component { | |
/* | |
essa abordagem ajuda carregar componentes mais rapido de forma async ao msm tempo q List inicializa :) | |
*/ | |
initAsync = async () => { | |
} |
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
<TouchableOpacity onPress={()=>{Views.navigator.navigate({ | |
routeName: 'Proxy', | |
params: {component:'List', title: 'Curtidas'}, | |
key: Backend.uuid() })}}> | |
<Text style={{fontSize: 16, margin:10}}>Curtidas</Text> | |
</TouchableOpacity> |
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 } from 'react-native'; | |
let moment = null | |
class Date extends Component { | |
initAsync = async () => { | |
moment = require('moment') | |
} | |
constructor(props) { |
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 Date from require('./components/Date.js') | |
export default class App extends Component { | |
initAsync = async (that) => { | |
} | |
constructor(props) { | |
super(props) |
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
def auth_user user=nil | |
#token = JWT.decode(params[:token], hmac_secret, true, { :algorithm => 'HS256' }) | |
token = request.env["HTTP_TOKEN"] | |
halt 401, "token + user are nil" if (token.blank? && user.blank?) | |
@user ||= CACHE.get(token) | |
unless @user.blank? | |
halt 400, "existent user for a blank token" if token.blank? |
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
uricache = URI.parse(ENV["REDIS_URL"]) | |
CACHE = Redis.new(:host => uricache.host, :port => uricache.port, :password => uricache.password) |
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
sha256 = Digest::SHA256.hexdigest "some key goes here you should generate yours" | |
HMAC_SECRET = sha256 |
OlderNewer