Skip to content

Instantly share code, notes, and snippets.

View ngocducpham's full-sized avatar
🦆
Duck GO

Ngọc Đức ngocducpham

🦆
Duck GO
View GitHub Profile
@ngocducpham
ngocducpham / image.jsx
Created March 28, 2025 08:20 — forked from lambdaxyzt/image.jsx
Remix Image Component ( use cache 'cacashe library' , stream base , sharp library )
// resource route component
import React from "react";
import { PassThrough } from "node:stream"
import fs from "node:fs"
import {createReadableStreamFromReadable} from "@remix-run/node"
import { defaultQuality,widths,mainImageReadStream,generatedImageReadstream, isThereImage,BadImageResponse } from "../../util/image.server"
export const loader = async ({ request }) => {
const url = new URL(request.url);
const src = url.searchParams.get("src");
@ngocducpham
ngocducpham / JetBrains trial reset.md
Created September 29, 2024 02:51
Reset all JetBrains products trial in Linux

In some cases, only these lines will work

for product in IntelliJIdea WebStorm DataGrip PhpStorm CLion PyCharm GoLand RubyMine; do
    rm -rf ~/.config/$product*/eval 2> /dev/null
    rm -rf ~/.config/JetBrains/$product*/eval 2> /dev/null
done

But if not, try these

@ngocducpham
ngocducpham / code.js
Last active May 5, 2023 17:10
Mercedes-benz-hextech-chest-quiz Multiple Choice
const delay = async (ms) => new Promise((res) => setTimeout(() => res(), ms));
let sheet = {
"Which of these items has no active ability?": ["Banshee's Veil"],
"Which of these items has an active ability?": ["Stopwatch"],
"Which of these Champions was not available at the start of League of Legends": ["Lux"],
"Which of these Champions was available at the start of League of Legends": ["Jax"],
"When do the Blue and Red buff spawn on Summoners Rift?": ["01:30"],
"Which player had the most kills (16) in a single game at MSI 2022?": ["Steal"],
"Who was Faker's most played champion at MSI 2022?": ["Ahri"],
"How much bonus gold does First Blood give?": ["200"],
@ngocducpham
ngocducpham / BalsamiqForever.py
Created September 18, 2022 14:48 — forked from HoussemNasri/BalsamiqForever.py
Extend your trial period for Balsamiq Wireframes on Windows and macOS Forever!
import json
import os
import time
import webbrowser
import sys
import re
def handleWindows(extra_seconds):
print("OS : Windows")
const courses=["PHED130715_04CLC","PHED130715_04CLC"],interval=5000;
setInterval(function(){courses.forEach(a=>{const b=a.split("_")[0],c=new FormData;c.set("txtSearch",b),fetch("https://dkmh.hcmute.edu.vn/DangkiKhac/Index",{method:"POST",body:c}).then(a=>a.text()).then(a=>new DOMParser().parseFromString(a,"text/html")).then(b=>{const c=b.querySelectorAll("#DanhSachLop > table > tbody > tr:nth-child(4) > td > fieldset > table > tbody > tr");for(let d of c){const b=d.querySelector("td:nth-child(3)");if(b?.innerText==a){const a=d.querySelector("input").id+"|",b=new FormData;b.set("hdID",a),fetch("https://dkmh.hcmute.edu.vn/DangKiNgoaiKeHoach/DanhSachLopHocPhanPost",{method:"POST",body:b}).then(a=>a.text()).then(a=>{const b=new DOMParser().parseFromString(a,"text/html").querySelector("#form0 > fieldset > table > tbody > tr:nth-child(9) > td > p").innerText;console.log(b)}).catch(()=>{console.log("Trang tr\u01B0\u1EDDng l\u1ED7i m\u1EB9 r\u1ED3i, login l\u1EA1i th\u1EED ph\xE1t")})}}}).catch(()=>{console.log("Kh