Skip to content

Instantly share code, notes, and snippets.

@auryn31
auryn31 / investing.py
Last active January 4, 2024 15:15
Monthly investing vs weekly investing
# %%
import csv
import datetime
import pandas as pd
from typing import Tuple, List
from datetime import date
# %%
years = 10
@auryn31
auryn31 / script.sh
Created November 17, 2023 17:09
Cut video based on timestamp into pieces
#!/bin/bash
# Input file containing timestamps and text
input_file="input.txt"
output_file="output.txt"
# Original video file
original_file="meme.mp4"
# Output directory for the new files
output_directory="output"
@auryn31
auryn31 / decrypt_pdf.sh
Last active April 5, 2022 11:34
Remove a password of an Encrypted PDF using Terminal, more options: https://qpdf.readthedocs.io/en/latest/cli.html
brew install qpdf
qpdf --password=*** --decrypt input.pdf output.pdf
#![feature(proc_macro_hygiene, decl_macro)]
#[macro_use]
extern crate rocket;
extern crate chrono;
extern crate reqwest;
use anyhow::Result;
use chrono::{Duration, Local};
use redis::{Commands, Connection};
import requests
import json
import http.server
import socketserver
from http import HTTPStatus
import redis
from datetime import datetime
from urllib.parse import urlparse
import urllib.parse as urlparse
from urllib.parse import parse_qs
@auryn31
auryn31 / osx_bootstrap.sh
Last active June 22, 2022 08:53 — forked from codeinthehole/osx_bootstrap.sh
Script to install stuff I want on a new OSX machine
#!/usr/bin/env bash
#
# Bootstrap script for setting up a new OSX machine
#
# This should be idempotent so it can be run multiple times.
#
# Apps without brew installation:
# - Magnet https://magnet.crowdcafe.com https://apps.apple.com/app/id441258766?mt=12
#
#
{
"_links": {
"self": {
"href": "http://localhost:8080/users/51"
},
"users": {
"href": "http://localhost:8080/users"
}
},
"id": 51,
@GetMapping("/users/{id}")
fun specificUser(@PathVariable id: Int): ResponseEntity<EntityModel<User>> {
if(dataBean.users.filter { it.id == id }.isEmpty()){
return ResponseEntity(HttpStatus.NOT_FOUND)
}
return ResponseEntity(EntityModel(dataBean.users.filter { it.id == id }.first(),
linkTo(methodOn(UserController::class.java).specificUser(id)).withSelfRel(),
linkTo(methodOn(UserController::class.java).allUsers()).withRel("users")), HttpStatus.OK)
}
serverless invoke local --function price --data '{"queryStringParameters":{"url":"https://www.amazon.de/Raspberry-Pi-ARM-Cortex-A72-Bluetooth-Micro-HDMI/dp/B07TC2BK1X/"}}'
@auryn31
auryn31 / block5.js
Last active September 25, 2019 19:15
const axios = require('axios').default;
const JSDOM = require('jsdom').JSDOM;
module.exports.price = async event => {
if(event.queryStringParameters == undefined || event.queryStringParameters.url == undefined) {
return {
statusCode: 404,
body: JSON.stringify({
message: "You forgot the URL parameter!"
})