Skip to content

Instantly share code, notes, and snippets.

View JoaquimLey's full-sized avatar
👨‍💻
Product oriented, software perfectionist and developer

Joaquim Ley JoaquimLey

👨‍💻
Product oriented, software perfectionist and developer
View GitHub Profile
@JoaquimLey
JoaquimLey / CurrentTimeParserUtil.java
Last active August 14, 2016 14:02
Get current DAY_MONTH_YEAR_HOUR_MINUTES_SECONDS
Calendar now = Calendar.getInstance();
int year = now.get(Calendar.YEAR);
int month = now.get(Calendar.MONTH); // Note: Starts at 0
int day = now.get(Calendar.DAY_OF_MONTH);
int hour = now.get(Calendar.HOUR_OF_DAY);
int minute = now.get(Calendar.MINUTE);
int second = now.get(Calendar.SECOND);
int millis = now.get(Calendar.MILLISECOND);
// NOTE: Starts at 0, hence month + 1
System.out.printf("%d-%02d-%02d %02d:%02d:%02d.%03d", year, month + 1, day, hour, minute, second, millis);
@JoaquimLey
JoaquimLey / restart-ssh-gist.sh
Created August 10, 2016 23:02
Restart ssh-agent
killall ssh-agent; eval `ssh-agent`
@JoaquimLey
JoaquimLey / github_multiple-accounts.md
Last active April 30, 2023 22:17
How to Work with GitHub and Multiple Accounts

Step 1 - Create a New SSH Key

We need to generate a unique SSH key for our second GitHub account.

ssh-keygen -t rsa -C "your-email-address"

Be careful that you don't over-write your existing key for your personal account. Instead, when prompted, save the file as id_rsa_COMPANY. In my case, I've saved the file to ~/.ssh/id_rsa_work.

Step 2 - Attach the New Key

@JoaquimLey
JoaquimLey / create_new_ssh_key.md
Last active April 4, 2024 11:07
Generating a new SSH key and adding it to the ssh-agent

Generating a new ssh-key

Open Terminal. Paste the text below, substituting in your GitHub email address.

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

This creates a new ssh key, using the provided email as a label

Generating public/private rsa key pair.

@JoaquimLey
JoaquimLey / .travis.yml
Last active August 14, 2016 14:01
Travis config for Android
language: android
jdk:
# Jdk version used by your project
- oraclejdk8
sudo: false
android:
components:
@JoaquimLey
JoaquimLey / .gitignore
Last active August 14, 2016 13:58
Pretty standard/complete .gitignore with focus on Android
# Local files
/local.properties
/build
/captures
# Built application files
*.apk
*.ap_
# Files for the Dalvik VM
@JoaquimLey
JoaquimLey / ssh-add.sh
Last active August 2, 2018 01:12
Add ssh identity
ssh-add ~/.ssh/id_rsa
@JoaquimLey
JoaquimLey / debug_over_wifi.md
Last active October 7, 2021 00:18
Debug over WIFI

How to Debug with your device over WIFI

  1. Connect the device via USB and make sure debugging is enabled.

  2. Run adb tcpip 5555

  3. Find the IP address

MACOS: adb shell ip route

@JoaquimLey
JoaquimLey / CircleImageTransforation.md
Created August 17, 2016 21:55
Transform an ImageView into circular shape, works with Picasso

Using Picasso with a circular ImageView

With this helper class you can transform your ordinary ImageView into ciruclar shape using Picasso library.

###Include this class into your project:

package com.<YOUR-PACKAGE-NAME>
	
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
@JoaquimLey
JoaquimLey / ManualChangeUser.md
Last active November 14, 2018 02:52
Change github user on terminal, manual way

First restart the ssh agent

  killall ssh-agent; eval `ssh-agent`

You should see something along the lines of: Agent pid 59566

Now just add your "new" user .ssh key

ssh-add ~/.ssh/id_rsa