Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Jakub lenisko

🏠
Working from home
  • Poland
Block or report user

Report or block lenisko

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
@lenisko
lenisko / jwt-expiration.md
Created Jul 31, 2019 — forked from soulmachine/jwt-expiration.md
How to deal with JWT expiration?
View jwt-expiration.md

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:

@lenisko
lenisko / gist:db937642b294d651507866b1aa8c7adb
Created Feb 14, 2019 — forked from Ayms/gist:6451926
WebCrypto code example - Upload a file, encrypt it, calculate the hash and store the results using indexedDB
View gist:db937642b294d651507866b1aa8c7adb

Code example using WebCrypto, File API, indexedDB, createObjectURL and Workers.

<input type="file" onsubmit="process_upload">
var workerjs=' \
  onmessage=function(evt) { \
		var encrypt=crypto.workersubtle.encrypt({name:"AES-CBC",iv:new Uint8Array(16)},evt.data[0]); \
		var buffer=evt.data[1]; \
View gist:1643f6c0837bfde47fae2c69845ebea4
<?xml version="1.0" encoding="utf-8" ?>
<Device_Info>
<DeviceInfoVers>0001</DeviceInfoVers>
<CommApiVers>0301</CommApiVers>
<Gen>0002</Gen>
<BrandCode>0</BrandCode>
<ProductCategory>01</ProductCategory>
<CategoryName>AV RECEIVER</CategoryName>
<ManualModelName>AVR-X1400H</ManualModelName>
<DeliveryCode>02</DeliveryCode>
@lenisko
lenisko / mumble_info.py
Created Dec 1, 2018
Script used to send PING to Mumble server and get data
View mumble_info.py
#!/usr/bin/python
"""
Author: @lenisko
Script used to send PING to Mumble server and get data:
- server version
- ping
- users
- max users
- bandwidth
"""
View tobii.py
import logging
import clr
clr.AddReference("Tobii.Interaction.Net")
clr.AddReference("Tobii.Interaction.Model")
clr.AddReference("EyeXFramework")
clr.AddReference("System")
from Tobii.Interaction import *
from Tobii.Interaction.Framework import *
from System import *
@lenisko
lenisko / kill_not_active_pts.py
Created Oct 10, 2017
Simple python script used to kill not active pts sessions
View kill_not_active_pts.py
#!/usr/bin/python
"""
Author: @lenisko
Simple python script used to kill not active pts sessions.
"""
import re
import subprocess
@lenisko
lenisko / SteamBulkKeyActivatorEN.ahk
Created Nov 30, 2016
Steam Bulk Key Activator - For systems with English language
View SteamBulkKeyActivatorEN.ahk
; Copyright 2014 colingg (colin.gg)
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
@lenisko
lenisko / SteamBulkKeyActivatorPL.ahk
Created Nov 30, 2016
Steam Bulk Key Activator - For systems with Polish language
View SteamBulkKeyActivatorPL.ahk
; Copyright 2014 colingg (colin.gg)
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
View Has weird right-to-left characters.txt
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@lenisko
lenisko / dark_gentleman.css
Created Jan 12, 2016
Pisg - dark gentleman theme
View dark_gentleman.css
/* <!--
Pisg - dark gentleman theme
based on https://gist.github.com/Liamraystanley/5924421
by lazy Len
--> */
a {
color: #0088FF;
}
a:link {
text-decoration: none;
You can’t perform that action at this time.