This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# %% | |
import csv | |
import datetime | |
import pandas as pd | |
from typing import Tuple, List | |
from datetime import date | |
# %% | |
years = 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install qpdf | |
qpdf --password=*** --decrypt input.pdf output.pdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![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}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
# | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"_links": { | |
"self": { | |
"href": "http://localhost:8080/users/51" | |
}, | |
"users": { | |
"href": "http://localhost:8080/users" | |
} | |
}, | |
"id": 51, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
serverless invoke local --function price --data '{"queryStringParameters":{"url":"https://www.amazon.de/Raspberry-Pi-ARM-Cortex-A72-Bluetooth-Micro-HDMI/dp/B07TC2BK1X/"}}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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!" | |
}) |
NewerOlder