Skip to content

Instantly share code, notes, and snippets.

@hamelsmu
hamelsmu / chapters.py
Created July 6, 2025 03:16
YouTube Chapter Generator - Generate summaries and timestamps for YouTube videos using Gemini API
#!/usr/bin/env python3
# /// script
# requires-python = ">=3.9"
# dependencies = [
# "httpx",
# "typer",
# "rich",
# ]
# ///
"""
@andrasbacsai
andrasbacsai / firewall.sh
Last active April 19, 2025 14:31
Update a Hetzner Firewall rule with your IP address
#!/bin/bash
# Script to update a firewall rule in a Hetzner Firewall with your current IP address.
# Good if you would like to restrict SSH access only for your current IP address (secure).
#################
# WARNING: This script will overwrite all rules in the firewall rules, so make sure you
# added all the required rules.
# I use a separate firewall rule just for SSH access.
#################
@hamelsmu
hamelsmu / webhook-circleback.py
Created April 25, 2024 04:59
Generate a project proposal automatically from a meeting transcript
from fastapi import Request, HTTPException
from pydantic import BaseModel, BaseModel, HttpUrl
from modal import Secret, App, web_endpoint, Image
from typing import Optional, List
from example import proposal
import os
app = App(name="circleback", image=Image.debian_slim().pip_install("openai", "pydantic", "fastapi"))
class Attendee(BaseModel):
@rameerez
rameerez / exit_the_cloud.md
Last active June 15, 2025 09:09
☁️ How I got off the cloud and migrated everything from AWS to a VPS in Hetzner

☁️ How I got off the cloud and migrated everything from AWS to a VPS in Hetzner

This is an opinionated handbook on how I migrated all my Rails apps off the cloud and into VPS.

This is how I manage real production loads for my Rails apps. It assumes:

  • Rails 7+
  • Ruby 3+
  • PostgreSQL
  • Ubuntu Server 24.04
  • Capistrano, Puma, Nginx
@Krazete
Krazete / genBash.js
Created April 25, 2021 22:34
Download an MP4 file from a master.json's list of M4S files.
function genBash(masterURL) {
var xhr = new XMLHttpRequest();
xhr.open("GET", masterURL, true);
xhr.addEventListener("load", function () {
var master = JSON.parse(this.responseText);
var baseURL = new URL(master.base_url, masterURL);
function genBashLines(mp4, type) {
var mp4BaseURL = new URL(mp4.base_url, baseURL);
var segmentURLs = mp4.segments.map(segment => segment.url);
@tprynn
tprynn / util.js
Last active February 1, 2022 13:34
Frida utility functions
module.exports = {
hexStringToIntArray: function(str) {
var res = []
for(var i = 0; i < str.length; i += 2) {
res.push(parseInt(str.substring(i, i+2), 16))
}
return res
},
byteArrayToHexString: function(array) {
@Andrious
Andrious / ListViewScrollController.dart
Last active March 9, 2023 15:29
ListView ScrollController Example
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp(
items: List<String>.generate(10000, (i) => "Item $i"),
));
}
class MyApp extends StatefulWidget {
@kannaiah
kannaiah / bash-cheatsheet.sh
Created March 26, 2019 17:16 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04