Skip to content

Instantly share code, notes, and snippets.

View nemesisqp's full-sized avatar

NĐQP nemesisqp

  • Vietnam
View GitHub Profile
@nemesisqp
nemesisqp / classifyPrice.ts
Created November 19, 2024 13:28
GPT classify price
type Currency =
| "USD" | "EUR" | "GBP" | "JPY" | "AUD" | "CAD" | "CHF" | "CNY" | "SEK" | "NZD"
| "MXN" | "SGD" | "HKD" | "NOK" | "KRW" | "TRY" | "INR" | "RUB" | "BRL" | "ZAR"
| "DKK" | "PLN" | "THB" | "IDR" | "MYR" | "PHP" | "CZK" | "HUF" | "ILS" | "SAR"
| "AED" | "CLP" | "COP" | "ARS" | "VND" | "EGP" | "BDT" | "PKR" | "NGN" | "GHS";
interface PriceRange {
low: number; // Lower bound for "low" in USD
medium: number; // Lower bound for "medium" in USD
high: number; // Lower bound for "high" in USD
import { VirtualTypeScriptEnvironment } from "@typescript/vfs";
import { CompilerOptions } from "typescript";
enum ModuleResolutionKind {
Classic = 1,
NodeJs = 2,
}
importScripts("https://unpkg.com/@typescript/[email protected]/dist/vfs.globals.js");
importScripts(
@nemesisqp
nemesisqp / vercel.md
Created April 18, 2024 06:44 — forked from ky28059/vercel.md
Deploying to Vercel from an organization for free using GitHub actions

This gist was partially inspired by this blog about Next.js Vercel CI with GitHub actions.

The problem

An easy way to deploy and host websites for free is to use GitHub pages. If you've deployed a Next.js project to GitHub pages, you may have used a GitHub action similar to this in the past to automatically redeploy the site when a new commit is pushed:

# gh-pages-merge.yml
name: Deploy to gh-pages on merge
on:
  push:
@nemesisqp
nemesisqp / outbound-email-with-cloudflare.md
Created December 3, 2023 17:33 — forked from irazasyed/outbound-email-with-cloudflare.md
Using Gmail SMTP with Cloudflare Email Routing: A Step-by-Step Guide

Using Gmail SMTP with Cloudflare Email Routing: Step-by-Step Guide

Learn how to send emails through Gmail SMTP with Cloudflare Email Routing in this comprehensive guide.

Step 1: Enable 2-Factor Authentication

To proceed with this method, ensure that you have enabled two-factor authentication for your Google account. If you haven't done so already, you can follow the link to set it up → Enable 2FA in your Google account.

Step 2: Create an App Password for Mail

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCjB6hsrmtqR99UpxkF3MoX4HPGNFsWxasAbotOcOv+pbmlLvrmOVK1UvSWSMRV8KTkQUhNK87fqPz0p8FXwGtVuzkHZRQFpn05WJN/5Fgr523Mh6V2aqLjkEzbIi3YI1WEjN8q4Yw9nj3YoEl4XJJaBEj75YHv/PS+gbHT3x/61lrTSvgQDTVCMjeBff5mvnUehWZon9E3c2aLl7Vs79d6LAxGq5ht1DBtrPzj6c5BtlwbseJFhCs/5b5nAcCVTmP+rf5Rv4HHZmLbgw1GmP/FtTKzWkHQjdgSg32fGEe5D+r1mUJFt6hag5C9HVpAVPNKagIfUPubHAq5sVu+iOMMAQhKWEUqiS//ZsluXDiUXxiyeSz1En8qgW5T//CubYjpvPhmVwU7YS4rp4ilVHNCj+ZbMtr4M7tzfTMW+lEW+/TUkd4oSWor45qIyTnGe2yxXpHHHAyGops47gdRSuGw5+uF4iHaFVGquDVrk+BQk8Oh+EJZqmLSt3g5kKTywt0=
@nemesisqp
nemesisqp / embed-ui.min.js
Last active June 18, 2020 05:02
test public embed-ui.min.js
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){n(1),e.exports=n(6)},function(e,t,n){var r=n(2);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:
@nemesisqp
nemesisqp / maplife-app-slashscreen.patch
Last active June 12, 2020 05:23
maplife app slashscreen patch
Index: src/pages/splash-screen.vue
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/pages/splash-screen.vue (date 1591939356733)
+++ src/pages/splash-screen.vue (date 1591939356733)
@@ -0,0 +1,54 @@
+<template>
+ <video
@nemesisqp
nemesisqp / gist:8d47707f3de009b5df07d44052407c0a
Created March 19, 2020 05:27
3000 từ hán việt phổ biến (1 từ có thể có nhiều nghĩa khác nhau)
THIÊN: Trời
ĐỊA: Đất
CỬ: Cất
TỒN: Còn
TỬ: Con
TÔN: Cháu
LỤC: Sáu
TAM: Ba
GIA: Nhà
QUỐC: Nước
@nemesisqp
nemesisqp / AuthyToOtherAuthenticator.md
Created April 25, 2019 05:44 — forked from gboudreau/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Generating Authy passwords on other authenticators


There is an increasing count of applications which use Authy for two-factor authentication. However many users who aren't using Authy, have their own authenticator setup up already and do not wish to use two applications for generating passwords.

Since I use 1Password for all of my password storing/generating needs, I was looking for a solution to use Authy passwords on that. I couldn't find any completely working solutions, however I stumbled upon a gist by Brian Hartvigsen. His post had a neat code with it to generate QR codes (beware, through Google) for you to use on your favorite authenticator.

His method is to extract the secret keys using Authy's Google Chrome app via Developer Tools. If this was not possible, I guess people would be reverse engineering the Android app or something like that. But when I tried that code, nothing appeared on the screen. My gues

@nemesisqp
nemesisqp / encode.sh
Created April 25, 2019 00:01 — forked from jeffpamer/encode.sh
Smooth Scrubbing Web Video FFMPEG Mega Command
ffmpeg -i input.mp4 -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -level 3 -an -vf "scale=-1:1440, reverse" -preset veryslow -g 2 output.mp4
// -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -level 3
// Encode for web with a good balance of browser compatibility and compression ratio
// -an
// Strip audio tracks
// -vf "scale=-1:1440, reverse"
// Scale video to 1440px wide, maintaining aspect ratio