Skip to content

Instantly share code, notes, and snippets.

Avatar

Christian Passold Chrispassold

View GitHub Profile
@Chrispassold
Chrispassold / build.gradle
Created June 7, 2018 14:41
Change name app build
View build.gradle
release {
debuggable false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
applicationVariants.all { variant ->
variant.outputs.each { output ->
output.outputFile = new File(output.outputFile.parent, output.outputFile.name.
replace("app-dev-release.apk", "App-" + versionName + "-develop.apk"))
output.outputFile = new File(output.outputFile.parent, output.outputFile.name.
replace("app-prod-release.apk", "App-" + versionName + ".apk"))
@Chrispassold
Chrispassold / find_process_linux_kill.txt
Created September 6, 2018 18:29
Find process in linux and kill
View find_process_linux_kill.txt
ps -A | grep firefox
kill PID
View git commands
https://stackoverflow.com/a/42903805
Delete the most recent commit, keeping the work you've done:
git reset --soft HEAD~1
Delete the most recent commit, destroying the work you've done:
git reset --hard HEAD~1
@Chrispassold
Chrispassold / netbeans.conf
Last active November 9, 2018 12:50
Netbeans great config
View netbeans.conf
netbeans_default_userdir="${DEFAULT_USERDIR_ROOT}/8.0.2"
netbeans_default_cachedir="${DEFAULT_CACHEDIR_ROOT}/8.0.2"
netbeans_default_options="-J-client -J-Xverify:none -J-Xss2m -J-Xms256m -J-Xmx1024m -J-XX:PermSize=128m -J-XX:MaxPermSize=1000m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.java2d.dpiaware=true -J-Dsun.zip.disableMemoryMapping=true -J-Dnetbeans.logger.console=true -J-XX:+UseConcMarkSweepGC -J-XX:+CMSClassUnloadingEnabled -J-XX:CompileThreshold=100 -J-Djava.net.preferIPv4Stack=true -J-DsvnClientAdapterFactory=commandline -J-Duser.language=en -J-Duser.region=US -J-DpreferGradle=true -J-Dplugin.manager.check.updates=false -J-Dnetbeans.extbrowser.manual_chrome_plugin_install=yes"
netbeans_jdkhome="C:\Java\jdk1.8.0_101"
@Chrispassold
Chrispassold / Creating docker machine
Last active March 14, 2019 11:30
Docker Desktop Hyperv (Windows)
View Creating docker machine
#Powershell with admin mode
#https://docs.docker.com/machine/get-started/
To create a new docker machine you should have a virtual switch on Hyperv Manager
This post helps me: https://github.com/docker/machine/issues/4328
Then you can create
docker-machine create -d hyperv --hyperv-virtual-switch <NAME VIRTUAL SWICHT> <NEW MACHINE NAME>
& "C:\Program Files\Docker\Docker\Resources\bin\docker-machine.exe" env default | Invoke-Expression
@Chrispassold
Chrispassold / 07032019
Last active March 16, 2019 03:54
Computação gráfica
View 07032019
#Introdução
- Dados
- Tipos de Informação
- Raster
- Resolução
- Profundidade de cor
- Vetorial
- Dimensão da informação
- 1D, 2D, 3D, 4D, 5D
- Sistema referência
@Chrispassold
Chrispassold / NetworkOnlyBoundResource.kt
Created July 3, 2019 19:46
Same logic of NetworkBoundResource but only with network data
View NetworkOnlyBoundResource.kt
import android.content.Context
import io.reactivex.Flowable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.exceptions.Exceptions
import io.reactivex.schedulers.Schedulers
import retrofit2.HttpException
import retrofit2.Response
import timber.log.Timber
import java.io.IOException
@Chrispassold
Chrispassold / build.gradle
Created September 9, 2019 11:34
Helpers for build gradle
View build.gradle
buildscript {
ext.versionMajor = 1
ext.versionMinor = 0
ext.versionPatch = 0
ext.generateVersionCode = {
return ext.minSdkVersion * 10000000 + ext.versionMajor * 10000 + ext.versionMinor * 100 + ext.versionPatch
}
ext.generateVersionName = {
@Chrispassold
Chrispassold / TimeInput.js
Created October 18, 2019 00:20
Time input with validation and simple mask
View TimeInput.js
import React from 'react';
import { Input } from 'semantic-ui-react';
class TimeInput extends React.Component {
state = {
time: '',
}
handleChange = (event, { name, value }) => {
value = value.replace(":", "")
View PermissionHelper.kt
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.net.Uri
import android.provider.Settings
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat