Skip to content

Instantly share code, notes, and snippets.

View ceosilvajr's full-sized avatar
🎯
focused

Ariel Silva Jr ceosilvajr

🎯
focused
View GitHub Profile
@ceosilvajr
ceosilvajr / gcloud-update-gradle.sh
Created May 21, 2020 18:08
Script to update gcloud gradle version
cd /opt/
gradle -version
sudo wget https://services.gradle.org/distributions/gradle-6.4.1-all.zip
sudo unzip gradle-6.4.1-all.zip
sudo rm -rf gradle
sudo mv gradle-6.4.1 gradle
gradle -version
@ceosilvajr
ceosilvajr / MovableFabButton.kt
Last active October 31, 2019 11:19
Give you fab a movable experience
class MovableFabButton : FloatingActionButton, View.OnTouchListener {
private var downRawX: Float = 0.toFloat()
private var downRawY: Float = 0.toFloat()
private var dX: Float = 0.toFloat()
private var dY: Float = 0.toFloat()
constructor(context: Context) : super(context) {
init()
}
@ceosilvajr
ceosilvajr / Update remote repo
Created March 27, 2017 04:28 — forked from mandiwise/Update remote repo
Transfer repo from Bitbucket to Github
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
// See also: http://www.paulund.co.uk/change-url-of-git-repository
$ cd $HOME/Code/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git
$ git push origin master
$ git remote rm bitbucket
@ceosilvajr
ceosilvajr / checkstyle.gradle
Created December 2, 2016 09:20 — forked from kboyarshinov/checkstyle.gradle
Code quality gradle scripts for Android
/**
* Checkstyle tasks
* Usage:
* - place this file under root dir of your project at /gradle directory
* - apply script from your gradle file:
* apply from : "{rootDir}/gradle/checkstyle.gradle"
*
* To configure checkstyle use configs at:
* "{rootDir}/config/checkstyle/checkstyle.xml" - for main projects
* "{rootDir}/config/checkstyle/checkstyle-test.xml" - for tests
@ceosilvajr
ceosilvajr / gcloud_commands
Created August 18, 2016 13:47 — forked from frntn/gcloud_commands
all gcloud commands
gcloud auth
gcloud auth activate-refresh-token
gcloud auth activate-service-account
gcloud auth git-helper
gcloud auth list
gcloud auth login
gcloud auth print-access-token
gcloud auth print-refresh-token
gcloud auth revoke
gcloud components
/*
* Copyright (c) 2015 WiseTime Pty Ltd. All rights reserved.
*/
package com.pi.account.server.utils.s3;
import org.apache.commons.fileupload.FileItemIterator;
import org.apache.commons.fileupload.FileItemStream;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.apache.commons.fileupload.util.Streams;
import org.apache.commons.io.FilenameUtils;
@ceosilvajr
ceosilvajr / springer-free-maths-books.md
Created December 29, 2015 05:39 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of maths books available for free, here are the direct links
@ceosilvajr
ceosilvajr / Item.java
Created September 25, 2015 16:15
Sample ListView
package com.softwen.ashonlineshop.objects;
/**
* Created by ceosilvajr on 9/25/15.
*/
public class Item {
private String name;
private double price;
@ceosilvajr
ceosilvajr / DigitalClock.java
Last active August 29, 2015 14:25 — forked from derekstavis/DigitalClock.java
DigitalClock HH:MM for Android
package com.derekstavis;
public class DigitalClock extends TextView {
private int hours;
private int minutes;
private int seconds;
private Timer clockTimer;
private final TimerTask clockTask = new TimerTask() {
@Override
@ceosilvajr
ceosilvajr / SMSHelper
Created June 4, 2015 08:26
Android SMSHelper
import android.app.Activity;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.telephony.SmsManager;
import android.util.Log;
/**