Skip to content

Instantly share code, notes, and snippets.

View lucianomlima's full-sized avatar
👨‍💻

Luciano Lima lucianomlima

👨‍💻
View GitHub Profile
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@lucianomlima
lucianomlima / jQuery otimizado
Created January 28, 2015 14:41
Exemplo de otimização de código jQuery
/**
* Código antes da otimização
* Fornecido por Ricardo Miranda
*/
/*
$(document).ready(function () {
try {
$('#orelha').delay(5000).animate({
@lucianomlima
lucianomlima / .bashrc
Last active August 21, 2018 22:28
.bashrc file
# Homebrew bash completion
COMPLETIONS="docker gem grunt vagrant"
COMPLETION_DIR=$(brew --prefix)/etc
. $COMPLETION_DIR/bash_completion
for i in $COMPLETIONS; do
if [ -f $COMPLETION_DIR/bash_completion.d/$i ]; then
. $COMPLETION_DIR/bash_completion.d/$i
fi
done
@lucianomlima
lucianomlima / androidAPKCopy.js
Created May 5, 2016 15:36
Cordova hook script to make a copy of an APK file after build.
module.exports = function(context) {
// make sure android platform is part of build
if (context.opts.platforms.indexOf('android') < 0) {
return;
}
var fs = context.requireCordovaModule('fs'),
path = context.requireCordovaModule('path'),
ConfigParser = context.requireCordovaModule('cordova-lib').configparser;
@lucianomlima
lucianomlima / EatController.js
Created May 13, 2016 15:57
Pequena parte de código do controller de Gastronomia de um aplicativo, referente a Geolocalização e cálculo de distância.
/**
* @class App.controller.Eat
* @extends Ext.app.Controller
* Controller da parte de Gastronomia
*/
Ext.define('App.controller.Eat', {
extend: 'Ext.app.Controller',
config: {
// Some code here...
},
@lucianomlima
lucianomlima / git-rename-tag
Created July 22, 2016 14:36
Script bash para renomear tags de um repositório Git
#!/bin/bash
TAG_LIST=`git tag -l | grep VERSION_`
BRANCH=`git rev-parse --abbrev-ref HEAD`
for TAG in $TAG_LIST
do
NEW_TAG=$(echo $TAG | sed s/VERSION_/v/ | sed s/_/\./g)
echo Renomeando tag $TAG para $NEW_TAG
git tag $NEW_TAG $TAG
dependencies {
compile project(':RCTYouTube')
compile project(':react-native-android-location-services-dialog-box')
compile project(':react-native-share')
compile project(':react-native-fetch-blob')
compile project(':react-native-svg')
compile project(':react-native-fabric-twitterkit')
compile project(':react-native-facebook-login')
compile (project(':react-native-device-info')) {
exclude group: 'com.google.android.gms', module: 'play-services-gcm'
import React, { Component, PropTypes } from 'react';
import { BackAndroid, Image, Platform, View } from 'react-native';
import Drawer from 'react-native-drawer';
import { Actions, DefaultRenderer } from 'react-native-router-flux';
import DFPBanner from './DFPBanner';
import Menu from '../containers/Menu';
import { getDrawerStyles, drawerTweenHandler } from '../styles/menu';
import { banner } from '../styles';
@lucianomlima
lucianomlima / scenes.js
Created February 23, 2017 21:48
React Native Scenes example
import React from 'react';
import { Actions, Modal, Scene } from 'react-native-router-flux';
module.exports = Actions.create(
<Scene key={'modal'} component={Modal}>
<Scene
key={'root'}
leftButtonIconStyle={styles.navBarButtonIcon}>
<Scene key={'drawer'} component={NavigationDrawer} open={false}>
<Scene
@lucianomlima
lucianomlima / php_version
Last active March 21, 2017 22:37 — forked from alex-arriaga/sphp
PHP Switcher Script; configure following this great post: https://getgrav.org/blog/mac-os-x-apache-setup-multiple-php-versions
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Usage: php_version [phpversion]"
exit 1
fi
currentversion="`php -r \"echo str_replace('.', '', substr(phpversion(), 0, 3));\"`"
newversion="$1"