Skip to content

Instantly share code, notes, and snippets.

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

Phoomparin Mano heypoom

🏠
Working from home
View GitHub Profile
const getShopeeOrderData = () => [...document.querySelectorAll('.order-card__container')].map(node => ({
name: node.querySelector('.order-content__item__name').innerText,
price: parseInt(node.querySelector('.purchase-card-buttons__total-price').innerText.slice(1).replaceAll(',', '')),
orderURL: node.querySelector('.order-content__item-wrapper').href
}))
// First, go to https://shopee.co.th/user/purchase, and open DevTools.
// Step 1 - Run this code to scroll all the way to the bottom.
const timer = setInterval(() => scrollTo(0, 10000000), 800)
setTimeout(() => {
// Step 2 - Stop scrolling after 1 minute.
clearInterval(timer)
// Step 3 - Sum the total purchase price!
async function run() {
const wait = ms => new Promise(resolve => setTimeout(resolve, ms))
const selector = 'div[aria-label="Toggle to follow"] div'
const nodes = [...document.querySelectorAll(selector)]
for (let node of nodes) {
const text = node.parentElement.parentElement.parentElement.innerText
console.log(text)

Hey, I'm Poom!

@heypoom
heypoom / keybase.md
Created December 25, 2020 05:21
keybase.md

Keybase proof

I hereby claim:

  • I am heypoom on github.
  • I am phoomparin (https://keybase.io/phoomparin) on keybase.
  • I have a public key whose fingerprint is CEF4 D7CC 960A BC86 CF21 7924 C131 6F6C E737 E008

To claim this, I am signing this object:

const readline = require("readline")
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
})
const read = (query) => new Promise((r) => rl.question(query, r))
const print = console.log
@babel/runtime
@emotion/cache
@emotion/core
@emotion/css
@emotion/hash
@emotion/is-prop-valid
@emotion/memoize
@emotion/serialize
@emotion/sheet
@emotion/styled
@heypoom
heypoom / download-from-undraw.py
Created April 2, 2020 12:37
Download every svg file from undraw.
#!/usr/bin/env python3
import os
import json
import requests
from multiprocessing.pool import ThreadPool
def build_index():
page = 1
urls = []
from random import randint
# Randomize an integer between 0 to n.
def randomize(maximum):
return randint(0, maximum)
class OpenClosedGame:
is_playing = False
import * as React from 'react'
import {useState} from 'react'
import ReactDOM from 'react-dom'
function FileReader() {
const [text, setText] = useState('')
function onChange(e: React.ChangeEvent<HTMLInputElement>) {
const {files} = e.target
const [file] = files