Skip to content

Instantly share code, notes, and snippets.

View Jhoem's full-sized avatar
🏠
Working from home

Jhoemer Costales Jhoem

🏠
Working from home
View GitHub Profile

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r
@Jhoem
Jhoem / gist:536cc8f85dedf6f36376b71784691498
Created June 30, 2022 05:28 — 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:
@Jhoem
Jhoem / jwt.strategy.ts
Last active November 22, 2023 06:41
Sample logout on nestjs using Cache manager w/ Redis for invalidating tokens
async logout({ jwt }) {
const { token, exp: expirationTime = 0 } = jwt;
// Convert current date to timestamp in seconds
const currentTimestamp = Math.floor(Date.now() / 1000);
const remainingTTL = expirationTime - currentTimestamp;
if (remainingTTL <= 0) {
throw new UnauthorizedException(AuthErrors.tokenExpired);
}
@Jhoem
Jhoem / example.js
Created March 13, 2024 04:52
Mikro orm sortable columns excluding relations
if (params.sort.length) {
// entity-level sortable columns only, doesn't include relationships
const sortableColumns: string[] = filter(
this.em.getMetadata(PicklistProductEntity.name).properties,
({ reference }) => reference === 'scalar'
).map(({ name }) => name);
if (params.sort.every((sort) => sortableColumns.includes(sort))) {
options.orderBy = params.sort.reduce((acc, key, i) => {
acc[key] = params.sortDirection