Skip to content

Instantly share code, notes, and snippets.

View JefferyHus's full-sized avatar
🦄
Hunting unicodes

Jeffery ThaGintoki JefferyHus

🦄
Hunting unicodes
View GitHub Profile
@JefferyHus
JefferyHus / jwt-expiration.md
Created March 12, 2020 19:04 — forked from soulmachine/jwt-expiration.md
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:

@JefferyHus
JefferyHus / gist:e3772241b3dac8d4145a197952b4c973
Last active January 19, 2020 19:38 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@JefferyHus
JefferyHus / introrx.md
Created May 19, 2019 04:57 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@JefferyHus
JefferyHus / states.sql
Created October 30, 2018 21:50 — forked from JeremyMorgan/states.sql
An SQL Query to insert 50 U.S. States into a database. Make sure your auto increment is set in MySQL, and Identity_insert is set in MS-SQL.
CREATE TABLE [state](
[stateID] [int] IDENTITY(1,1) NOT NULL,
[stateCode] [nchar](2) NOT NULL,
[stateName] [nvarchar](128) NOT NULL,
CONSTRAINT [PK_state] PRIMARY KEY CLUSTERED
( [stateID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY])
ON [PRIMARY]
@JefferyHus
JefferyHus / nginx-tuning.md
Created October 28, 2018 01:36 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@JefferyHus
JefferyHus / fb-open-graph.liquid
Created May 31, 2017 00:57 — forked from chrisjhoughton/fb-open-graph.liquid
Facebook Open Graph meta tags for Shopify. Add this as a snippet called "fb-open-graph.liquid" in your theme, and then add {% include 'fb-open-graph' %} to your theme.liquid file.
{% if template contains 'product' %}
<meta property="og:type" content="product">
<meta property="og:title" content="{{ product.title | strip_html | escape }}">
<meta property="og:category" content="{{ product.type }}" />
{% for image in product.images limit:3 %}
<meta property="og:image" content="http:{{ image.src | product_img_url: 'master' }}">
<meta property="og:image:secure_url" content="https:{{ image.src | product_img_url: 'master' }}">
{% endfor %}
<meta property="og:price:amount" content="{{ product.price | money_without_currency | stip_html | escape | remove: ',' }}">
<meta property="og:price:currency" content="{{ shop.currency }}">
@JefferyHus
JefferyHus / readme.md
Created January 6, 2017 17:37 — forked from coolaj86/how-to-publish-to-npm.md
How to publish packages to NPM

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser