Skip to content

Instantly share code, notes, and snippets.

@ravecat
ravecat / session_cookie_inspector
Last active April 26, 2025 23:17
session_cookie_inspector
We can't make this file beautiful and searchable because it's too large.
@ravecat
ravecat / config.exs
Last active April 4, 2024 00:07
Callback ueberauth tests
config :ueberauth, Ueberauth,
providers: [
auth0: {Ueberauth.Strategy.Auth0, [ignores_csrf_attack: true]}
],
json_library: Poison
@ravecat
ravecat / benchmark.js
Created October 25, 2020 19:31
node, time, benchmark
const begin = process.hrtime.bigint();
{...}
const diff = (process.hrtime.bigint() - begin) / 1000000n;
@ravecat
ravecat / eventEmitter.js
Created October 20, 2020 18:01
event, emitter, js
const emitter = () => {
const events = new Map();
const wrapped = new Map();
const ee = {
on: (name, f, timeout = 0) => {
const event = events.get(name);
if (event) event.push(f);
else events.set(name, [f]);
if (timeout) setTimeout(() => {
ee.remove(name, f);
const downloadAsCSVFile = function(csv, fname) {
let csvfile = new Blob([csv], {type: 'text/csv'})
let downlink = document.createElement('a')
downlink.download = fname
downlink.href = window.URL.createObjectURL(csvfile)
downlink.style.display = 'none'
document.body.appendChild(downlink)
downlink.click()
@ravecat
ravecat / parse_args.sh
Last active December 14, 2020 22:46
bash
function get_help () {
cat << EOF
Help
EOF
}
function handle_kwarg () {
if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
@ravecat
ravecat / extract_archive
Last active October 17, 2020 20:44
linux, tips
extract () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xvjf $1 ;;
*.tar.gz) tar xvzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) rar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xvf $1 ;;
*.xz) unxz $1 ;;
@ravecat
ravecat / vscode_debugging_chrome
Last active February 22, 2021 09:43
ide, vscode, debugging
{
"type": "chrome",
"request": "launch",
"name": "chrome",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
@ravecat
ravecat / debootstrap.md
Last active July 3, 2025 08:03
debootstrap, livecd

A live CD or live DVD is a complete bootable Linux operating system loaded from a CD or DVD. Although there are a lots of live Linux CDs, for seemingly every taste and purpose, it might still be useful on occasion to build your own. This guide details the steps to build a bootable live CD/DVD based on Debian “wheezy”.

Step 1 – Installing the necessary software

These are the software packages you need to install on your Debian system:

apt-get install xorriso live-build syslinux squashfs-tools

Step 2 – Create a basic filesystem