Skip to content

Instantly share code, notes, and snippets.

@battleoverflow
battleoverflow / scanner.ps1
Created March 23, 2022 19:43
Powershell Port Scanner (one-liner)
foreach ($r in 1..254) { Test-NetConnection -Port $r }
// Core assets
let coreAssets = [];
// On install, cache core assets
self.addEventListener('install', function (event) {
// Cache core assets
event.waitUntil(caches.open('app').then(function (cache) {
for (let asset of coreAssets) {
cache.add(new Request(asset));
@RamonWill
RamonWill / TkinterTemplate.py
Last active May 14, 2025 13:26
Tkinter GUI template
import tkinter as tk
from tkinter import messagebox
from tkinter import ttk
"""
Useful Links:
https://stackoverflow.com/questions/7546050/switch-between-two-frames-in-tkinter Most useful in my opinion
https://www.tutorialspoint.com/python/python_gui_programming.htm
https://anzeljg.github.io/rin2/book2/2405/docs/tkinter/index.html
@JoelLisenby
JoelLisenby / ffmpeg.sh
Last active August 13, 2024 01:51
ffmpeg video encoding for web (chrome, firefox, safari, etc)
# h265
ffmpeg -i input.mp4 -c:v libx265 -vf scale=1280:720 -pix_fmt yuv420p output.mp4
# h265 with colorspace specified
ffmpeg -i input.mp4 -c:v libx265 -vf scale=1280:720 -pix_fmt yuv420p -color_primaries bt709 -color_trc bt709 -colorspace bt709 output.mp4
# h265 with colorspace specified and no audio
ffmpeg -i input.mp4 -c:v libx265 -vf scale=1280:720 -pix_fmt yuv420p -color_primaries bt709 -color_trc bt709 -colorspace bt709 -an output.mp4
# webm
@lomboboo
lomboboo / watermark.php
Last active August 16, 2024 01:20
PHP add watermark with centered diagonal text
<?php
// recursive search by pattern
function rsearch($folder, $pattern) {
$dir = new RecursiveDirectoryIterator($folder);
$ite = new RecursiveIteratorIterator($dir);
$files = new RegexIterator($ite, $pattern, RegexIterator::GET_MATCH);
$fileList = array();
foreach($files as $file) {
$fileList = array_merge($fileList, $file);
}
@pich4ya
pich4ya / Swoopy.py
Last active June 4, 2024 02:48
Decrypt Chrome/Opera Saved Passwords - 2018
# https://geekswipe.net/technology/computing/swoop-chrome-passwords-decrypt-with-python/
# https://github.com/karthikeyankc/Swoopy/blob/master/Swoopy.py
# INSTALL: https://github.com/mhammond/pywin32/releases
import os
import sqlite3
import win32crypt
#path to user's login data
@brandonjank
brandonjank / LuaUnlocker.cs
Last active February 2, 2025 01:08
lua unlocker for 1.12 to 3.3.5a using hwbp method
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
namespace ConsoleApplication1 {
public enum Expansion {
@mdonkers
mdonkers / server.py
Last active June 2, 2025 09:47
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
@c-kick
c-kick / hnl.mobileConsole.js
Last active May 8, 2025 10:01
NOTE: V2 Released! Seehttps://github.com/c-kick/mobileConsole hnl.mobileConsole.js - extends JavaScript's console to display a visual console inside the webpage. Very usefull for debugging JS on mobile devices with no real console. Info and demo: http://www.hnldesign.nl/work/code/mobileconsole-javascript-console-for-mobile-devices/
/*!
*
* NEW VERSION AT https://github.com/c-kick/mobileConsole
*
* hnl.mobileConsole - javascript mobile console - v1.3.8 - 04/01/2021
* Adds html console to webpage. Especially useful for debugging JS on mobile devices.
* Supports 'log', 'trace', 'info', 'warn', 'error', 'group', 'groupEnd', 'table', 'assert', 'clear'
* Inspired by code by Jakub Fiala (https://gist.github.com/jakubfiala/8fe3461ab6508f46003d)
* Licensed under the MIT license
*
; The official HD AI
; An Artificial Intelligence Script written by Archon and Promiskuitiv
; Get in contact with Promiskuitiv by sending a mail to [email protected]
; List of taunts it reacts to:
; Standard taunts.
; 33 - Stop slinging resources. If slinging is requested early and is immediately canceled it may mess up the strategy.
; 38 - Sling Resources. Human player only, stops any unit production except for civilian units.