Skip to content

Instantly share code, notes, and snippets.

// Head over to https://github.com/rigwild/anons-secret-nft :)
@rigwild
rigwild / style.css
Last active October 17, 2021 15:59
Initial source: 100 Bytes of CSS to look great everywhere - https://dev.to/swyx/100-bytes-of-css-to-look-great-everywhere-19pd - or use https://watercss.kognise.dev/
html {
max-width: 70ch;
padding: 1rem;
margin: auto;
line-height: 1.75rem;
font-size: 1rem;
font-family: "Open Sans", Arial, sans-serif;
}
h1, h2, h3, h4, h5, h6 {
/// <reference path="./types.ts" />
// @ts-check
'use strict'
/** @param {string}str */
const strToUint8Array = str => new TextEncoder().encode(str)
/** @param {Uint8Array}uint8Array */
@rigwild
rigwild / install.sh
Last active December 3, 2023 01:17
Quick VM install script
#!/bin/bash
# Check if script is ran by root user -> exit
if [[ $EUID -eq 0 ]]; then echo "This script should not be ran by root!"; exit 1; fi
# Stop script on error
set -e
set -o pipefail
sudo apt update
@rigwild
rigwild / debouncedTasksQueue.ts
Last active September 26, 2021 12:50
Debounced task queue, will skip function calls if serialized arguments were already seen recently
export type Task<F extends (...args: any) => any> = { thisArg: any; fn: F; args: Parameters<F> }
/**
* Debounced task queue, will skip function calls if serialized arguments were already seen recently
*
* @author rigwild <me@rigwild.dev> (https://github.com/rigwild)
* @see https://gist.github.com/rigwild/02c28eb3e73075804cb1002a808dc343
*/
export class DebouncedTasksQueue {
private debounceMs: number = 10000
@rigwild
rigwild / thispersondoesnotexist.mjs
Created June 12, 2021 12:29
Download tons of AI generated human faces using https://github.com/google/zx
#!/usr/bin/env zx
const download = async () => {
await $`wget -nv -O - https://thispersondoesnotexist.com/image > file.jpg`
const sha1 = (await $`sha1sum file.jpg`).toString().split(' ')[0]
const exists = (await $`ls`.pipe(nothrow($`grep ${sha1}.jpg`))).toString().trim() !== ''
if (!exists) {
$`mv file.jpg ${sha1}.jpg`
return true
}
@rigwild
rigwild / paypalPhishingSpam.ts
Last active April 29, 2021 11:42
just spam some shitty credit cards details to paypal phishing webite
import faker from 'faker'
import { spawn, Pool, Worker } from 'threads'
let count = 1
const rand = (min: number, max: number) => Math.floor(Math.random() * (max - min + 1)) + min
;(async () => {
const pool = Pool(() => spawn(new Worker('./paypalPhishingSpam.worker.mjs')))
@rigwild
rigwild / twitter.ts
Created April 24, 2021 16:57
Clear all your Twitter account tweets and likes
import { TwitterClient } from 'twitter-api-client' // yarn add twitter-api-client
// You can use this project to get your user token:
// To see your token, add `console.log(tokens)` in `OAuth Step 3` in `express/src/index.js`
// https://github.com/QuodAI/tutorial-react-twitter-api-login
const twitterClient = new TwitterClient({
apiKey: '', // app client id
apiSecret: '', // app client secret
accessToken: '', // user access token
@rigwild
rigwild / squid.conf
Last active March 20, 2021 10:48
Unauthenticated Squid proxy that only accepts local connections and chain with an authenticated proxy
# /etc/squid/squid.conf
# http_access allow all
http_port 59371
coredump_dir /var/spool/squid3
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern (Release|Packages(.gz)*)$ 0 20% 2880
@rigwild
rigwild / expose.sh
Created March 17, 2021 12:36
Expose local port using localtunnel https://github.com/localtunnel/localtunnel
# yarn global add localtunnel
lt --port 8080 --subdomain mytestsubdomain --local-host localhost --print-requests