Skip to content

Instantly share code, notes, and snippets.

View ceosilvajr's full-sized avatar
🎯
focused

Ariel Silva Jr ceosilvajr

🎯
focused
View GitHub Profile
public class HumanTime {
/**
* A (propably bad) implementation for human readable relative times.
*
* @param ms
* @return
*/
public final static String humanReadableString(long ms) {
@ceosilvajr
ceosilvajr / HelpFragment
Created June 7, 2014 12:00
SAMPLE SERVER GOOGLE API KEY
package com.silva.fragments;
import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
@ceosilvajr
ceosilvajr / AES.c
Last active August 29, 2015 14:21 — forked from bricef/AES.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
* MCrypt API available online:
* http://linux.die.net/man/3/mcrypt
*/
#include <mcrypt.h>
@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;
/**
@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 / 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 / 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
/*
* 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 / 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
@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