Skip to content

Instantly share code, notes, and snippets.

Christian Passold Chrispassold

Block or report user

Report or block Chrispassold

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Chrispassold
Chrispassold / TimeInput.js
Created Oct 18, 2019
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(":", "")
@Chrispassold
Chrispassold / build.gradle
Created Sep 9, 2019
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 / NetworkOnlyBoundResource.kt
Created Jul 3, 2019
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 / 07032019
Last active Mar 16, 2019
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 / Creating docker machine
Last active Mar 14, 2019
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
View S3BUCKET
[{"id":"fbb47df.cfdae8","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"921e4718.36eaa8","type":"rpi-dht22","z":"fbb47df.cfdae8","name":"","topic":"rpi-dht22","dht":22,"pintype":"0","pin":"18","x":564.5,"y":80,"wires":[["612eb64e.ca2458"]]},{"id":"8a63b616.e6a7e8","type":"twitter out","z":"fbb47df.cfdae8","twitter":"","name":"Twitter sender","x":1099,"y":113,"wires":[]},{"id":"612eb64e.ca2458","type":"function","z":"fbb47df.cfdae8","name":"Build message","func":"\nvar date = new Date();\n\nmsg.payload = 'hora: ' + date.getTime() + ', temperatura: ' + msg.payload + ', umidade: ' + msg.humidity ;\n\nreturn msg;","outputs":1,"noerr":0,"x":876,"y":90,"wires":[["8a63b616.e6a7e8"]]},{"id":"c9fb2e28.900e2","type":"AWS Rekognition","z":"fbb47df.cfdae8","aws":"cf9a3ab5.55fd28","operation":"DetectText","SourceImage":"","TargetImage":"","CollectionId":"","Input":"","Output":"","Name":"","Settings":"","RoleArn":"","FaceIds":"","Image":"{ \"S3Object\": { \"Bucket\": \"concentrado-raspb
@Chrispassold
Chrispassold / netbeans.conf
Last active Nov 9, 2018
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"
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 / find_process_linux_kill.txt
Created Sep 6, 2018
Find process in linux and kill
View find_process_linux_kill.txt
ps -A | grep firefox
kill PID
@Chrispassold
Chrispassold / build.gradle
Created Jun 7, 2018
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"))
You can’t perform that action at this time.