Skip to content

Instantly share code, notes, and snippets.

View android10's full-sized avatar
👇
fernandocejas.com

Fernando Cejas android10

👇
fernandocejas.com
View GitHub Profile
@android10
android10 / AndroidApplication.java
Created July 20, 2016 09:56
Android: how to know if your app is completely hidden
public class AndroidApplication extends MultiDexApplication {
public static final String TAG = AndroidApplication.class.getSimpleName();
@Override
public void onCreate() {
super.onCreate();
registerComponentCallbacks(new ComponentCallback());
}
private class ComponentCallback implements ComponentCallbacks2 {
@android10
android10 / build.gradle
Last active August 29, 2023 14:31
Compile and launch android app from the command line.
task deployDebug(type: Exec, dependsOn: 'app:installDebug') {
def rootDir = project.rootDir
def localProperties = new File(rootDir, "local.properties")
if (localProperties.exists()) {
Properties properties = new Properties()
localProperties.withInputStream {
inputStream -> properties.load(inputStream)
}
def sdkDir = properties.getProperty('sdk.dir')
def adb = "$sdkDir/platform-tools/adb"
@android10
android10 / build.gradle
Created September 7, 2017 16:31
Execute Script from Gradle Task - Firebase TestLab Example
// Firebase TestLab Example using Flank
task assembleAppApkForFirebase(dependsOn: ':app:assembleDebug')
task assembleTestApkForFirebase(dependsOn: ':app:assembleDebugAndroidTest')
task runAcceptanceTestsOnFirebase(type: Exec, dependsOn: ['assembleAppApkForFirebase', 'assembleTestApkForFirebase']) {
description 'Assembles App and Test apks for execution on Firebase Test Lab.'
workingDir "$rootDir"
commandLine './scripts/flank_test.sh'
}
assembleAcceptanceTest.mustRunAfter('assembleAppApkForFirebase', 'assembleTestApkForFirebase')
@android10
android10 / pr.md
Created October 27, 2017 10:16 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@android10
android10 / install_ubuntu_fonts_rehat.md
Last active November 24, 2022 23:05
Install Ubuntu Fonts on RedHat/Fedora Linux

1 - Open the terminal and type below given command

cd /root
yum install wget       (you can skip this step if wget is already installed)
wget https://assets.ubuntu.com/v1/fad7939b-ubuntu-font-family-0.83.zip (check the newest version)

2 - Check if the directory /usr/share/fonts exist. If the fonts directory do not exist,you can create yourself.

@android10
android10 / [FEDORA] gitkraken
Last active November 13, 2019 18:59 — forked from aelkz/[FEDORA] gitkraken
How to install gitkraken on Fedora/RedHat + launcher icon
#!/bin/bash
# Download GitKraken
wget https://release.gitkraken.com/linux/gitkraken-amd64.tar.gz
# copy the downloaded file into /opt directory
cp gitkraken-amd64.tar.gz /opt/gitkraken
cd /opt
@android10
android10 / .bashrc
Created December 15, 2017 22:04
Fancy prompt with git branch support
# Fancy Terminal Prompt ----------------------------------------------------------
txtcyn=$'\e[0;36m' # Cyan
txtred=$'\e[0;31m' # Red
txtwht=$'\e[0;37m' # White
txtrst=$'\e[0m' # Text Reset
function parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
@android10
android10 / README.md
Last active November 29, 2020 00:50
Keep a FORKED repository synced with UPSTREAM on Github

Configure a remote that points to the upstream repository in Git.

  • List the current configured remote repository for your fork.
git remote -v
origin  git@github.com:YOUR_USERNAME/YOUR_FORK.git (fetch)
origin  git@github.com:YOUR_USERNAME/YOUR_FORK.git (push)
@android10
android10 / xps-9370.md
Created May 30, 2018 07:31 — forked from greigdp/xps-9370.md
Dell XPS 13 (9370) Archlinux Install Notes

Install Notes - Dell XPS 13 (9370) 2018

The laptop works well on Archlinux. A few notes based on the installation guide for the previous version.

Intel GPU Power Saving

Per the Arch wiki, more power can be saved by creating /etc/modprobe.d/i915.confwith the following content:

options i915 modeset=1 enable_rc6=1 enable_fbc=1 enable_guc_loading=1 enable_guc_submission=1 enable_psr=1
@android10
android10 / vpn.sh
Created August 20, 2018 15:19
LINUX: Script to facilitate running openvpn from the command line, especially when a Linux/Unix client is used with Access Server, the Access Server is unable to alter the DNS settings on the client in question causing issues on host resolving.
# -----------------------------------------------
# BEFORE USING THIS SCRIPT
# -----------------------------------------------
# 1 - Create a file in /etc/<yourpassfile>.pass which contains the vpn private key password.
# 2 - Set permission for the file: 'sudo chmod 600 /etc/<yourpassfile>.pass' - Owner can read and write.
# 3 - Create an alias in your .bashrc or bash_profile: alias vpn="sudo sh <path to your script>".
# 4 - Set the value of the variable OVPN_FILE_PATH with the path of the .ovpn file.
# 5 - Set the value of the variable OVPN_PRIVATE_KEY_FILE_PATH with the path of the created file in step #1: /etc/<yourpassfile>.pass
# 6 - OPTIONAL: avoid password when executing the script, add this to /etc/sudoers '<your username> ALL=(ALL:ALL) NOPASSWD:<path to your script>'