Skip to content

Instantly share code, notes, and snippets.

@cqsd
cqsd / genpickle.py
Created July 31, 2018 05:28
i don't know how to paste with newlines from windows to the linux subsystem, so here we are. im gonna curl it to my own machine
#!/usr/bin/env python
from __future__ import print_function
import codecs
import pickle
import subprocess
def exploit(cmd):
class Exploit(object):
def __reduce__(self):
import json
import boto3
s3 = boto3.client('s3')
def lambda_handler(event, context):
# s3 trigger can have multiple records
@cqsd
cqsd / unlike-tweets.js
Last active August 23, 2022 14:40
script to unlike tweets using twitter web (use on https://twitter.com/USERNAME/likes)
document.onscroll = (() => {
let totalUnliked = 0;
return async () => {
const tweets = document.querySelectorAll('[role="article"]');
await tweets.forEach(async e => {
const likeButton = document.querySelector('[data-testid="unlike"]');
if (typeof likeButton !== 'undefined' && likeButton) {
await likeButton.click();
totalUnliked += 1;
console.log(totalUnliked);
@cqsd
cqsd / dorks
Last active April 22, 2020 18:15
snippets
# find people who put their place of work in their twitter bio
site:twitter.com -inurl:status -inurl:statuses -inurl:lists -inurl:COMPANY "@COMPANY"
@cqsd
cqsd / style-rfc.js
Created June 30, 2020 10:08
bookmarklets
(function() {
const dbs = document.body.style;
dbs.color = '#eee';
dbs.background = '#222';
dbs.width = '800px';
dbs.margin = '0 auto';
console.log('it works fuck off');
for (const d of document.getElementsByClassName('docinfo')) {
d.style.background = '#111';
};
@cqsd
cqsd / async-limit.js
Created July 2, 2020 04:11
basically a closure-based semaphore
/**
* Limit concurrent asynchronous execution of a function.
*
* Stolen from this:
* https://dev.to/ycmjason/limit-concurrent-asynchronous-calls-5bae
*
* @param fn {Function} async function
* @paranm n {Number} max execution concurrency
*/
const asyncLimit = (fn, n) => {
@cqsd
cqsd / .eslintrc.js
Created February 9, 2021 01:38
default typescript vue project eslint + prettier
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'plugin:vue/vue3-essential',
@cqsd
cqsd / bullshit.md
Last active May 23, 2021 02:31
various kubernetes bullshit
@cqsd
cqsd / README.md
Created July 27, 2021 07:01
Typescript utils

Some functions I end up using in just about every js project.

@cqsd
cqsd / readme.md
Last active August 19, 2021 23:11
howto: docker init containers

howto: docker init containers

what is it

a container that sets up for other containers. for example, you could populate a database with seed data and share it with your real db container through a volume

support was added in this PR but i haven't seen easily google-able docs yet (maybe im just bad at searching)