Skip to content

Instantly share code, notes, and snippets.

@bazzargh
bazzargh / draw.html
Created December 30, 2022 14:29
rudimentary drawing program, that outputs bbc basic code to reproduce the image
<svg viewbox="0 0 255 255" id="svg_canvas" width="512" height="512" style="border: 1px solid black;">
</svg>
Click to add points.
<form id="form">
<input type="range" id="ppos__slider" min="0" max="0"><input type="text" id="ppos" enabled=false><label for="ppos">Point</label><br>
<input type="range" id="xpos__slider" min="0" max="255"><input type="text" id="xpos" enabled=false><label for="xpos">X</label><br>
<input type="range" id="ypos__slider" min="0" max="255"><input type="text" id="ypos" enabled=false><label for="ypos">Y</label><br>
<input type="range" id="cpos__slider" min="-32" max="32" value="0"><input type="text" id="cpos" enabled=false><label for="cpos">Curvature</label><br>
<input type="text" id="image" value=monalisa.jpg><label for="image">Image</label><br>
<input type="text" id="offsetx" value=0><label for="offsetx">X Offset</label><br>
@Fluepke
Fluepke / log_train.sh
Created November 12, 2022 15:16
Log train rides on german trains (location data, internet availability, speed, etc.)
#!/bin/bash
if ! command -v curl &> /dev/null; then
echo "This script needs curl. Please install curl."
exit -1
fi
if ! command -v jq &> /dev/null; then
echo "This script needs jq. Please install jq."
exit -1
@tzuntar
tzuntar / gopher2html.pl
Created January 1, 2022 15:34
Simple gophermap to HTML converter
#!/usr/bin/env perl
# Gopher2Html - Gophermap parser
# v1.0 (c) 2021 by Tobija Žuntar
use warnings;
use strict;
use feature qw(switch);
no warnings qw(experimental::smartmatch);
sub parse_line {
my ($line) = @_;
@rileytestut
rileytestut / ExportIPA.swift
Last active March 4, 2024 09:36
Export Swift Playgrounds .ipa
import Foundation
// Export running app as .ipa, then return path to exported file.
// Returns String because app crashes when returning URL from async function for some reason...
func exportIPA() async throws -> String
{
// Path to app bundle
let bundleURL = Bundle.main.bundleURL
// Create Payload/ directory
@LilithWittmann
LilithWittmann / autobahn.md
Last active October 26, 2023 12:11
autobahn.md
@m-radzikowski
m-radzikowski / script-template.sh
Last active May 4, 2024 04:13
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@munificent
munificent / generate.c
Last active May 7, 2024 06:19
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
@flowchartsman
flowchartsman / kali_osx_persistence_wifi.md
Last active June 14, 2023 13:00 — forked from widdowquinn/kali_osx_persistence_wifi.md
Kali Linux Live USB with encrypted persistence and wireless on Macbook Pro/Air without networking.

Kali Linux Bootable USB with Persistence and Wireless on OSX

Tutorials for running live Kali on OSX often require you have networking on your laptop to apt install the drivers, but without an ethernet adapter you're not going to be able to do that, so this tutorial will cover a method of doing this manually, using another thumbdrive or external data source.

Download the appropriate Kali Linux .iso

I used a 64 bit .iso image, downloaded via HTTP.

@jimfoltz
jimfoltz / tw5-server.rb
Last active February 26, 2024 02:18
A local server for TiddlyWiki5 that allows saving wiki.
require 'webrick'
require 'fileutils'
if ARGV.length != 0
root = ARGV.first.gsub('\\', '/')
else
root = '.'
end
BACKUP_DIR = 'bak'
@oubiwann
oubiwann / appify.sh
Last active April 29, 2023 10:32 — forked from advorak/appify.sh
appify — create the simplest possible Mac app from a shell script (adds an application icon)
#!/usr/bin/env bash
VERSION=4.0.1
SCRIPT=`basename "$0"`
APPNAME="My App"
APPICONS="/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericApplicationIcon.icns"
OSX_VERSION=`sw_vers -productVersion`
PWD=`pwd`
function usage {