Skip to content

Instantly share code, notes, and snippets.

@3ximus
3ximus / http-server.py
Created April 27, 2024 23:51
A better implementation of python's simple http server
#!/bin/env python3
# A better implementation of simple http server, it allows for:
# - logging of headers and body content
# - serving files on a directory
# - saving files in body into an output directory
import http.server
import argparse
import sys
@3ximus
3ximus / patch-slack-croissantizer.js
Last active September 27, 2023 16:30
Prevent Slack Croissantizer
var originalOpen = originalOpen ? originalOpen : XMLHttpRequest.prototype.open;
XMLHttpRequest.prototype.open = function (method, url) {
this._url = url;
return originalOpen.apply(this, arguments);
};
const MESSAGE = [
{
type: "rich_text",
elements: [
@3ximus
3ximus / open_sheets.sh
Last active August 25, 2023 00:00
Upload excel file to google sheets and open it in firefox
#!/bin/bash
# Open an excel file in google sheets
# Reads file contents from stdin. The first argument is the name of the file, if omited 'temp.xlsx' is given
# You'll need to give your own key underneath. If you don't have one just inspect a drive file upload request and get it from there
# NOTE Depends on ./extract_cookies.sh script (https://gist.github.com/hackerb9/d382e09683a52dcac492ebcdaf1b79af)
APIKEY='<your-api-key>'
$(dirname ${BASH_SOURCE[0]})/extract_cookies.sh ~/.mozilla/firefox/*.default-release/cookies.sqlite > /tmp/sheets_upload_cookies.txt
@3ximus
3ximus / install_netcdf_tools.sh
Last active April 28, 2021 15:25
Install script for netcdf with a bunch of dependencies with intel fortran compiler. And ww3 setup.
#!/bin/bash
# vi: foldmethod=marker
# This script install most of the dependencies needed along with intel compiler
# - zlib
# - hdf5
# - netcdf4
# - netcdf4-fortran
# - eccodes
# - cdo