Skip to content

Instantly share code, notes, and snippets.

View fabiancabau's full-sized avatar
👾

Fabian Venturini Cabau fabiancabau

👾
  • ClientHub
  • Araraquara, SP
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:

@codediodeio
codediodeio / database.rules.json
Last active March 24, 2026 17:32
Common Database Rules for Firebase
// No Security
{
"rules": {
".read": true,
".write": true
}
}
@moshmage
moshmage / withinRadius.js
Last active April 18, 2022 09:22
compares two objects lat/lon and returns true if within provided kms
/**
* is One Point within Another
* @param point {Object} {latitude: Number, longitude: Number}
* @param interest {Object} {latitude: Number, longitude: Number}
* @param kms {Number}
* @returns {boolean}
*/
function withinRadius(point, interest, kms) {
'use strict';
@victorbstan
victorbstan / CarControl.cs
Last active September 11, 2023 05:29
Unity car simulation script
using UnityEngine;
using System.Collections;
public class CarControl : MonoBehaviour {
// NOTE: Companion script for wheel suspensions, attach to each wheel.
// https://gist.github.com/victorbstan/4dde0d0b4203c248423e
// PUBLIC
public bool driveable = false;
@CMCDragonkai
CMCDragonkai / angularjs_directive_attribute_explanation.md
Last active March 3, 2026 06:20
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>