Skip to content

Instantly share code, notes, and snippets.

View lucianomlima's full-sized avatar
👨‍💻

Luciano Lima lucianomlima

👨‍💻
View GitHub Profile
@lucianomlima
lucianomlima / executeShellInGradle
Created March 7, 2018 06:50 — forked from rishabhmhjn/executeShellInGradle
Executing shell commands and getting output in gradle
def getVersionName = { ->
def hashStdOut = new ByteArrayOutputStream()
exec {
commandLine "git", "rev-parse", "--short", "HEAD"
standardOutput = hashStdOut
}
def buildNumberStdOut = new ByteArrayOutputStream()
exec {
commandLine 'echo', "$BUILD_NUMBER"
@lucianomlima
lucianomlima / api.js
Last active August 18, 2020 18:29
Service API example using apisauce for React
/* eslint-disable no-console, no-param-reassign */
import { create } from 'apisauce';
import qs from 'qs';
import R from 'ramda';
import config from '../../config';
const api = create({
baseURL: config.baseURL,
headers: {
Accept: 'application/json',
@lucianomlima
lucianomlima / Cakes.js
Last active April 7, 2018 22:20 — forked from tosipaulo/react.js
React Cakes example component
import React from 'react';
import { Link } from 'react-router-dom';
import api from './Api';
class Cakes extends React.Component {
constructor(props){
super(props);
this.state = {
@lucianomlima
lucianomlima / index.js
Created October 12, 2017 22:00
React Native Geocoder example
import React from 'react';
import { View, Text } from 'react-native';
import Geocoder from 'react-native-geocoder';
// Chave do Google Maps
Geocoder.apiKey = 'AIza...';
export default class Example extends React.Component {
constructor(props) {
super(props);
@lucianomlima
lucianomlima / index.js
Last active January 17, 2023 13:35
Redux-saga Ajax API example
// ./app/sagas/index.js
import { all, takeLatest } from 'redux-saga/effects';
/* Services */
import api from '../services/api';
/* Redux Actions */
import { InitTypes } from '../redux/init';
import { UserTypes } from '../redux/user';
@lucianomlima
lucianomlima / snippets.cson
Last active April 18, 2018 03:10
React Native Atom snippets
{
".source.js":
"React: import component":
prefix: "li"
body: "import ${1} from './${1}';"
"React: constructor":
prefix: "construct"
body: "constructor(props) {\n\tsuper(props);\n\t${1}\n}"
@lucianomlima
lucianomlima / app.js
Created June 15, 2017 22:22
React Native one file script start
import React, { Component } from 'react';
import { Text, View } from 'react-native';
export default class App extends Component {
render() {
return (
<View>
<Text>Hello World!</Text>
</View>
);
@lucianomlima
lucianomlima / index.js
Created May 12, 2017 12:03
React Native upload image
async function uploadImage(data, frame, options) {
const formData = new FormData(); // eslint-disable-line no-undef
/**
* 'foto' é o nome do campo que você vai resgatar em uploadURL
* data é um objeto que possui o uri da imagem
* options são as opções da request (headers por exemplo)
*/
formData.append('foto', {
...data,
export default class MainScreen extends React.Component {
constructor(props) {
super(props);
this.ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1.id !== r2.id});
this.state = {
list: [],
dataSource: this.ds.cloneWithRows([]),
check: {},
checkAll: false,
@lucianomlima
lucianomlima / images.js
Created April 5, 2017 18:02
Exemplo de uso de ícones em SVG. Localização dos arquivos: app/config/
/* eslint-disable global-require */
const images = {
app_logo: require('../images/app_logo.png'),
carsystem_logo: require('../images/carsystem_logo.png'),
carsystem_tecnologia_logo: require('../images/carsystem_tecnologia_logo.png'),
ibahia: require('../images/ibahia.png'),
ibahia_mono: require('../images/ibahia_mono.png'),
circuitos: {
dodo: require('../images/circuito_dodo.png'),
osmar: require('../images/circuito_osmar.png')