Skip to content

Instantly share code, notes, and snippets.

View kivimango's full-sized avatar

Kivimango kivimango

  • EU
View GitHub Profile
@soulmachine
soulmachine / jwt-expiration.md
Last active May 3, 2026 13:29
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:

@mattgathu
mattgathu / main.rs
Last active November 7, 2024 07:53
Simple Event Hooks in Rust, Observer pattern in Rust
use std::io;
use std::str;
use std::error::Error;
use std::io::{Read, Write};
use std::net::TcpStream;
#[allow(unused_variables)]
pub trait Events {
fn on_connect(&self, host: &str, port: i32) {}
fn on_error(&self, err: &str) {}
@nicolasdao
nicolasdao / open_source_licenses.md
Last active May 2, 2026 10:14
What you need to know to choose an open source license.
@thomasheller
thomasheller / INSTALL.md
Last active April 14, 2026 17:07
Install Arch Linux in VirtualBox VM
@anggadarkprince
anggadarkprince / AppHelper.java
Last active May 2, 2023 22:39
Upload file with Multipart Request Volley Android
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import java.io.ByteArrayOutputStream;
/**
* Sketch Project Studio
* Created by Angga on 12/04/2016 14.27.
*/
public class AppHelper {
@kra3
kra3 / eq.preset
Created March 26, 2014 12:11
Audacious presets: ~/.config/audacious/eq.preset
[Presets]
Preset0=Classical
Preset1=Club
Preset2=Dance
Preset3=Flat
Preset4=Live
Preset5=Laptop Speakers/Headphone
Preset6=Rock
Preset7=Pop
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream