Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# tput is a command to manipulate the terminal, it can be used to change the color of text, apply effects, and generally brighten things up.
trap "tput reset; tput cnorm; exit" 2
clear
tput civis
lin=2
col=$(($(tput cols) / 2))
c=$((col - 1))
est=$((c - 2))
[...document.querySelectorAll('video')].find(video => !video.paused).playbackRate = 2;
var total = 0;
var order = 0;
function calculate(next) {
var opts = { method: 'GET', headers: {} };
fetch(
'https://shopee.com.my/api/v4/coin/get_user_coin_transaction_list?type=out&limit=20&offset=' +
next,
opts
)
var total = 0;
var order = 0;
function calculate(next) {
var opts = { method: 'GET', headers: {} };
fetch(
'https://shopee.com.my/api/v4/order/get_order_list?list_type=3&offset=' +
next,
opts
)
const claims = () => {
let clickCount = 1;
const claimButtons = Array.from(document.querySelectorAll('div > span'))
.filter(span => span.textContent.includes('Claim'))
.map(span => span.closest('div'));
const buttonCount = claimButtons.length;
console.log(`Total Claim Button: ${buttonCount}`);
const interval = setInterval(() => {
if (clickCount > buttonCount) {
@krsntn
krsntn / getExtensions.js
Created December 8, 2020 07:18
to get all your vscode extensions. copy & pase it on your vscode.
const {execSync, spawn} = require('child_process')
const result = execSync('code --list-extensions')
const list = String(result)
.split('\n')
.filter(Boolean)
.map(
x => `- [${x}](https://marketplace.visualstudio.com/items?itemName=${x})`
)
@krsntn
krsntn / spam_chat.scpt
Last active November 1, 2020 09:37
an AppleScript to spam on chat
delay 2
property currentCount : 1
set the clipboard to "input message"
repeat 100 times
tell application "System Events"
-- keystroke currentCount
-- keystroke ". "

Ubuntu

Change Username

usermod -l <newname> -d /home/<newname> -m <oldname>

Change Hostname

sudo vim /etc/hostname // change the name inside
sudo vim /etc/hosts // change the name inside

Array.from(document.querySelectorAll('video')).filter(x => !x.paused)[0].playbackRate = 1.5
@krsntn
krsntn / .bashrc
Created July 12, 2019 16:39
customize bash prompt
EMOJIS=('😏' '🀑' 'πŸ’©' 'πŸ€‘' 'πŸ˜“' '😡' 'πŸ‘»' 'πŸ€·β€β™‚οΈ' 'πŸ™ˆ' 'πŸ™‰' 'πŸ™Š' 'πŸ”' '🍟' '🍿' '🍻' 'πŸ’”' 'πŸ”«' '🧲' '🎊' 'πŸŽ‰' 'πŸ’°' 'πŸ’Έ' '🚽' 'πŸš‘' 'πŸš’' 'πŸš“' '🌡' '🀟' '🀘' 'πŸ––' 'πŸ€™' 'πŸ‘' 'πŸ–•' 'πŸ™…β€β™‚οΈ' 'πŸ€¦β€β™‚οΈ' 'πŸ€¦β€β™€οΈ' 'πŸ™…β€β™€οΈ' 'πŸ€·β€β™€οΈ' 'πŸ€–' '🀬' '😱' '😴' 'πŸ˜‘' 'πŸ˜’' '☠️');
RANDOM_EMOJI() {
SELECTED_EMOJI=${EMOJIS[$RANDOM % ${#EMOJIS[@]}]};
echo $SELECTED_EMOJI;
}
PS1='\[\033[38;5;243m\]\t\[\e[m\] $(RANDOM_EMOJI):\[\e[01;34m\]\w\[\e[m\]\\$ '