Skip to content

Instantly share code, notes, and snippets.

View renanfranca's full-sized avatar
😄

Renan Franca renanfranca

😄
View GitHub Profile
@cmelchior
cmelchior / AndroidManifest.xml
Last active December 25, 2015 13:59
Adding support for ".res-auto" in ContentProvider authorities in AndroidManifest.xml. This replaces ".res-auto" with the current package name, making it possible to install multiple build variants on the same devices without getting [INSTALL_FAILED_CONFLICTING_PROVIDER]
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.trifork.example"
android:installLocation="auto"
android:versionName="@string/client_info" >
<!-- ... -->
<application
android:hardwareAccelerated="true"
@neilsoult
neilsoult / LazyLoad.js
Created October 31, 2013 19:40
LazyLoad directive for loading external javascript for AngularJs. In this example, I use google maps' API as the external library being loaded
angular.module('testApp', []).
directive('lazyLoad', ['$window', '$q', function ($window, $q) {
function load_script() {
var s = document.createElement('script'); // use global document since Angular's $document is weak
s.src = 'https://maps.googleapis.com/maps/api/js?sensor=false&callback=initialize';
document.body.appendChild(s);
}
function lazyLoadApi(key) {
var deferred = $q.defer();
$window.initialize = function () {
@paour
paour / build_extras.gradle
Last active October 5, 2016 12:04
A simpler and more fool-proof way to handle search providers in Android Gradle builds
def overrideProviderAuthority(packageName, inFile, outFile) {
def xml = new XmlParser().parse(inFile)
xml.findAll{it.name() == 'string'}.each{item ->
if (!item.value().isEmpty() && item.value()[0] instanceof String && item.value()[0].startsWith(".res-auto")) {
item.value()[0] = item.value()[0].replace(".res-auto", packageName)
}
}
saveXML(outFile, xml)
angular.module('gps-test').factory('googleMapsLoader',
function($window, $q, $timeout) {
"use strict"
var loaded = false,
listeners = [];
function load_script(params, api_base_url) {
var url = api_base_url || 'https://maps.googleapis.com/maps/api/js?',
@danielesegato
danielesegato / AndroidBug-OptionItems-Fragments-29472-workaround.md
Last active March 27, 2019 13:40
Android Option Menu + Fragments Workaround with ViewPager / ActionBar / Drawer, Menu Items not displaying

This gist is a workaround to this bug:

https://code.google.com/p/android/issues/detail?id=29472

No changes are needed to your current code but changing the extended fragment/activity class.

All you have to do is put this two classes in your code and make your activity extend MenuManagerActivity and your fragment MenuDelegatorFragment. If you are using Nested fragment you must make sure that all fragments containing nested Fragments with options menu also extend MenuDelegatorFragment (both if the parent fragment need an option menu both if it doesn't need it).

@chrisbanes
chrisbanes / FloatLabelLayout.java
Last active March 15, 2024 06:39
FloatLabelLayout
/*
* Copyright 2014 Chris Banes
*
* Licensed 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
*
* Unless required by applicable law or agreed to in writing, software
/*
* Copyright (C) 2014 Chris Banes
*
* Licensed 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
*
* Unless required by applicable law or agreed to in writing, software
@chranderson
chranderson / nvmCommands.js
Last active June 14, 2024 19:15
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node
@luisfelipeas5
luisfelipeas5 / SonarQubeREADME.md
Last active February 6, 2024 12:27
Um guia para configurar o básico do SonarQube + Jacoco

Adicione o plugin do SonarQube

Primeiro, adicione ao build.gradle de nível de projeto:

buildscript {
   repositories {
       //...
       maven {
           url "https://plugins.gradle.org/m2/"
       }
@renanfranca
renanfranca / latest-blog-post-profile-workflow-manual.yml
Last active March 29, 2022 22:17
Automatically show yours latest blog post at your github profile
name: Latest blog post profile workflow manual
on:
workflow_dispatch:
jobs:
update-readme-with-blog:
name: Update this repo's README with latest blog posts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: gautamkrishnar/blog-post-workflow@master