Skip to content

Instantly share code, notes, and snippets.

Frank Dai soulmachine

Block or report user

Report or block soulmachine

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
soulmachine /
Created May 6, 2019
LearningRateBatchScheduler copied from experimental/resnet50_keras/
# Copied from
from absl import logging
from tensorflow.keras import backend as K
# Learning rate schedule
LR_SCHEDULE = [ # (multiplier, epoch to start) tuples
(1.0, 5), (0.1, 30), (0.01, 60), (0.001, 80)
soulmachine /
Created Jun 25, 2018 — forked from marklit/
Find the cheapest availability zone across all regions for an EC2 spot instance type
pip install sh
package me.soulmachine;
import java.util.*;
public class BleedingInk {
class State {
int x;
int y;
int parentDarkness;
soulmachine /
Created Dec 12, 2017
openssl aes encrypt command line
# encrypt file.txt to file.enc using 256-bit AES in CBC mode
openssl enc -e -aes-256-cbc -salt -in file.txt -out file.enc
# the same, only the output is base64 encoded for, e.g., e-mail
openssl enc -e -aes-256-cbc -a -salt -in file.txt -out file.enc
# decrypt binary file.enc
openssl enc -d -aes-256-cbc -in file.enc -out file.txt
# decrypt base64-encoded version
soulmachine /
Created Dec 12, 2017 — forked from guycalledseven/
Manually remove Paragon NTFS v15 leftovers MacOS
# Just delete .config and .support in folder "/Library/Application Support/Paragon Software/"
# then you will get an another 10 days trial.
# after appcleaner does his magic, do this
sudo rm -rf "/Library/Application Support/Paragon Software/"
sudo rm /Library/LaunchDaemons/com.paragon-software.installer.plist
sudo rm /Library/LaunchDaemons/com.paragon-software.ntfs.loader.plist
sudo rm /Library/LaunchDaemons/com.paragon-software.ntfsd.plist
sudo rm /Library/LaunchAgents/com.paragon-software.ntfs.notification-agent.plist
soulmachine /
Last active Oct 15, 2019
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:

View gist:752fb4ebfd2c9b6d6470928cb194855f
You can’t perform that action at this time.