Skip to content

Instantly share code, notes, and snippets.

View geovanisouza92's full-sized avatar
🏠
Working from home

Geo geovanisouza92

🏠
Working from home
View GitHub Profile
@geovanisouza92
geovanisouza92 / gist:2fb0755b28ac0216f6ea
Created May 5, 2014 16:55
Function to get android app database (only with debuggable apps)
#
# Append in .bashrc
#
# pulldb <app package> <database name>
#
function pulldb {
/home/geovani/android-sdk/platform-tools/adb -d shell "run-as $1 cat /data/data/$1/databases/$2 > /sdcard/$2"
/home/geovani/android-sdk/platform-tools/adb pull "/sdcard/$2"
}
@geovanisouza92
geovanisouza92 / M00_Setup.java
Created May 11, 2014 13:31
Database migration for Android/SQLite
package ...
import ...
/**
* Created by Geovani on 09/05/2014.
*/
public class M00_Setup implements Migration {
@Override
@geovanisouza92
geovanisouza92 / Foo.java
Created May 30, 2014 17:00
AndroidAnnotations + RoboBinding + Saripaar
// (AndroidAnnotations)
@EViewGroup(R.layout.view_foo)
class Foo extends LinearLayout implements PresentationModel<Bar> {
Bar model;
Listener listener;
// (Saripaar)
Validator validator;
// (AndroidAnnotations) + (Saripaar)
@ViewById @Required TextView foo_tv_goo;
@geovanisouza92
geovanisouza92 / virtualbox-unity.sh
Created August 25, 2014 17:06
Script to add shortcuts in VirtualBox icon on Ubuntu
#!/bin/bash
# Bash Script to integrate Virtualbox into Unity Launch bar.
# Creator: Daniel Scholtus
# Contributor: David Beitey
# Version: 1.1
# Date: 2012-07-05
#Determine which is installed, virtualbox or virtualbox-ose
#Given the packages are mutually exclusive, only one exists at any one time
if [ `type -P virtualbox` ]; then
@geovanisouza92
geovanisouza92 / cimp.py
Created September 4, 2014 16:42
Calcula preço de importação de produtos (aprox.)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=C0325,W0141
#
# Para executar o script pelo terminal, execute:
#
# $ chmod 755 cimp.py
# $ mkdir -p ~/.local/bin && cd $_
# $ ln -s <path to cimp.py> cimp
#
@geovanisouza92
geovanisouza92 / .bashrc
Created October 31, 2014 13:30
Send push notifications from shell
#
# Send push notifications from shell, like this:
#
# $ push Your message here
# $ echo 'Lorem ipsum or another awesome command' | push
# $ docker pull image/tag && push 'Image image/tag download done'
#
# Append the following lines in your ~/.bashrc and set your PUSHBULLET_APIKEY
# To update current bash session, run
# $ . ~/.bashrc
@geovanisouza92
geovanisouza92 / rules.less
Created November 26, 2014 12:14
Rules to expand "html /deep/" and "::shadow" classes for Polymer/WebComponents
// Rules
.shadow(@parent, @sel, @ruleset) {
@rule: ~"@{parent}::shadow @{sel}";
@{rule} {
@ruleset();
}
}
angular.module('app')
.config(configFn)
.factory('AuthInterceptor', AuthInterceptor);
/* @ngInject */
function configFn($httpProvider) {
$httpProvider.interceptors.push('AuthInterceptor');
}
/* @ngInject */
@geovanisouza92
geovanisouza92 / app.js
Created January 27, 2015 13:06
Angular.js sample directive
angular.module('myApp')
.directive('orderRequirement', orderRequirement);
/* @ngInject */
function orderRequirement() {
var directive = {
restrict: 'EA', // Restrict to [E]lement or [A]ttribute
templateUrl: 'partials/requirements-order-requirement.html', // HTML template
scope: { // Isolated scope, defining the tag attributes that binds to scope variables
orders: '=',
@geovanisouza92
geovanisouza92 / app.js
Last active August 29, 2015 14:14
Angular.js directive example 2
angular.module('myApp')
.factory('ApiClient', ApiClient)
.factory('IndividualResource', IndividualResource)
.directive('evolutionGraph', evolutionGraph);
/* @ngInject */
function ApiClient($http) { // Used to pipe request to Api host, shared with other angular services
var service = {
get: getFn,
},