Skip to content

Instantly share code, notes, and snippets.

@ThioJoe
ThioJoe / Error-Lookup-Tool-Friendly.bat
Last active March 29, 2024 07:09
Error Lookup Tool Friendly Output
@echo off
:: Note: Lines beginning with "REM" or :: are comments
:: Script by: https://github.com/thiojoe
:: Purpose: Creates a much more user friendly output for the Microsoft Error Lookup Tool (err.exe). It parses the original output and modifies the text.
:: Usage: Just call the batch file with command prompt along with the error code the same as you would with err.exe
:: Example: error.bat 50
:: Recommended to rename this script to something shorter like 'error.bat'. Must be next to the lookup tool exe file.
@james2doyle
james2doyle / getXML.go
Last active March 29, 2024 07:08
Use HTTP to GET and parse XML in golang
// tweaked from: https://stackoverflow.com/a/42718113/1170664
func getXML(url string) ([]byte, error) {
resp, err := http.Get(url)
if err != nil {
return []byte{}, fmt.Errorf("GET error: %v", err)
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
return []byte{}, fmt.Errorf("Status error: %v", resp.StatusCode)
@hakerdefo
hakerdefo / sources.list
Last active March 29, 2024 07:13
Ubuntu 22.04 LTS (Jammy Jellyfish) complete sources.list
deb http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
@badge
badge / demo.py
Last active March 29, 2024 07:04
from celery import Celery
from pydantic import BaseModel, TypeAdapter
from pydantic_serializer import PydanticCelerySerializer
app = Celery("tasks", broker="pyamqp://guest@localhost//", backend="rpc://")
class TaskDefinition(BaseModel):
x: int
@OrionReed
OrionReed / DOM3D.js
Last active March 29, 2024 07:04
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@jermicus
jermicus / Package-Sql-CU-tar.ps1
Created March 25, 2024 17:19
Fix missing assembly errors for SQL on Windows container image builds
<#
This script will help to address errors such as those below below when trying to build Windows container images with certain verions of SQL Server
This occurs with SQL 2016, 2017 as well as SQL 2022 if updates are included in the build
This script is specific to SQL 2022 and will extract the needed files from the a CU update without needing to install the update anywhere
The files will be packaged in a tar file that can be added to the image build
For 2016/2017, WizardFrameworkLite is also required and the missing files can be taken from the installation media
#>
<#
03/16/2023 09:11:46.863 [13296]: Detailed info about C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.NetEnterpriseServers.ExceptionMessageBox.resources\v4.0_16.0.0.0_de_89845dcd8080cc91
@jasoncoon
jasoncoon / LumosRingDemo.ino
Created April 23, 2022 20:35
FastLED DemoReel100 for LumosRing
// FastLED DemoReel100 for LumosRing by Bradán Lane STUDIO
// https://www.tindie.com/products/bradanlane/lumosring-circuitpython-led-ring-block/
#include <FastLED.h>
FASTLED_USING_NAMESPACE
// FastLED "100-lines-of-code" demo reel, showing just a few
// of the kinds of animation patterns you can quickly and easily
// compose using FastLED.
@adisbladis
adisbladis / podman-shell.nix
Last active March 29, 2024 07:03
Use podman within a nix-shell
{ pkgs ? import <nixpkgs> {} }:
let
# To use this shell.nix on NixOS your user needs to be configured as such:
# users.extraUsers.adisbladis = {
# subUidRanges = [{ startUid = 100000; count = 65536; }];
# subGidRanges = [{ startGid = 100000; count = 65536; }];
# };
@szepeviktor
szepeviktor / Wistia-download-videos.md
Last active March 29, 2024 07:03
Download Wistia videos - Please do not misuse it!

Download Wistia videos

  1. right-click on the playing video, select Copy link
  2. find Wistia video ID in the copied link e.g. wvideo=tra6gsm6rl
    • alternative: look for e.g. hashedId=tra6gsm6rl in the page source
  3. load http://fast.wistia.net/embed/iframe/ + video ID in your browser
  4. look for "type":"original" in the page source and copy the URL from the next line e.g. "url":"http://embed.wistia.com/deliveries/129720d1762175bcd8e06dcab926ec76ad38ff00.bin"
  • alternative: look for "type":"hd_mp4_video"