Skip to content

Instantly share code, notes, and snippets.

View thiagoricieri's full-sized avatar

Thiago Ricieri thiagoricieri

View GitHub Profile
@soulmachine
soulmachine / jwt-expiration.md
Last active June 19, 2025 15:38
How to deal with JWT expiration?

First of all, please note that token expiration and revoking are two different things.

  1. Expiration only happens for web apps, not for native mobile apps, because native apps never expire.
  2. Revoking only happens when (1) uses click the logout button on the website or native Apps;(2) users reset their passwords; (3) users revoke their tokens explicitly in the administration panel.

1. How to hadle JWT expiration

A JWT token that never expires is dangerous if the token is stolen then someone can always access the user's data.

Quoted from JWT RFC:

@ericsaboia
ericsaboia / statesAndCapitals.json
Created April 15, 2014 19:02
Brazilian's states and capitals
[
{ "name": "Acre", "code": "AC", "capital": "Rio Branco" },
{ "name": "Alagoas", "code": "AL", "capital": "Maceió" },
{ "name": "Amazonas", "code": "AM", "capital": "Manaus" },
{ "name": "Amapá", "code": "AP", "capital": "Macapá" },
{ "name": "Bahia", "code": "BA", "capital": "Salvador" },
{ "name": "Ceará", "code": "CE", "capital": "Fortaleza" },
{ "name": "Distrito Federal", "code": "DF", "capital": "Brasília" },
{ "name": "Espírito Santo", "code": "ES", "capital": "Vitória" },
{ "name": "Goiás", "code": "GO", "capital": "Goiânia" },
@johnjohndoe
johnjohndoe / android-sdk-setup.sh
Last active June 12, 2019 08:31
Creating symbolic links in Android SDK folder. After Android-Studio resp. IntelliJ will work with Maven and Gradle.
#!/bin/bash
# Author: Tobias Preuss
# Version: 2018-01-05
echo "Creating symbolic links in Android SDK folder"
echo "============================================="
echo
if [ -z "$ANDROID_HOME" ] ; then
@thiagoricieri
thiagoricieri / MyViewController.m
Created July 26, 2012 19:15
Implementação de um View Controller com UITableView
//
// MyViewController.m
// Projeto
//
// Created by Thiago Ricieri on 24/07/12.
// Copyright (c) 2012. All rights reserved.
//
#import "MyViewController.h"
@Jaybles
Jaybles / UIDeviceHardware.h
Created October 28, 2011 19:33
UIDeviceHardware - Determine iOS device being used
//
// UIDeviceHardware.h
//
// Used to determine EXACT version of device software is running on.
#import <Foundation/Foundation.h>
@interface UIDeviceHardware : NSObject
- (NSString *) platform;