Skip to content

Instantly share code, notes, and snippets.

View kwikwag's full-sized avatar

kwikwag kwikwag

  • Developer of the world
View GitHub Profile
@kwikwag
kwikwag / build.bat
Created August 22, 2017 22:54
Windows build batch file for Live555, based on instructions by @nspool
@rem Place this file at the live/ directory of the downloaded LIVE555 source files.
@rem Based on instructions at https://nspool.github.io/2016/02/building-live555/
@rem Tested with Visual Studio 2015 on Windows 10
@echo off
if exist "%TEMP%\sed.vbs" goto skip_gen_sed
> "%TEMP%\sed.vbs" (
REM thanks to https://stackoverflow.com/questions/127318/is-there-any-sed-like-utility-for-cmd-exe
@echo.Dim pat, patparts, rxp, inp
@echo.pat = WScript.Arguments(0^)
@kwikwag
kwikwag / rect_red.svg
Created April 16, 2018 06:57
SVG img tag sizing problem
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import argparse
import os
import random
parser = argparse.ArgumentParser()
parser.add_argument('file')
args = parser.parse_args()
data = []
read_size = 1024 * 4
@kwikwag
kwikwag / install-docker.sh
Created May 3, 2021 07:48
Install Docker on Ubuntu/Debian
#!/bin/bash
# based on https://docs.docker.com/engine/install/debian/
# and https://docs.docker.com/engine/install/ubuntu/
# at 2021-05-03
dist=$(lsb_release --id --short | awk '{ print tolower($0) }')
: : : Set up the Docker repository && \
sudo apt update && \
sudo apt -y install \
apt-transport-https \
@kwikwag
kwikwag / node-engine-strict.js
Created April 29, 2025 09:31
A script that ensures your project runs with a Node.js version that satisfies the `engines.node` field in your `package.json`, using either NVM or the system-installed Node.js.
/*
# `node-engine-strict.js`
A script that ensures your project runs with a Node.js version that satisfies
the `engines.node` field in your `package.json`.
It works by checking for a compatible version installed via **NVM** (Node
Version Manager), and will fall back to the system-installed Node.js if it's
compatible. If neither is suitable, the script exits with an error.
import multiprocessing.managers
import multiprocessing.pool
import queue
from contextlib import contextmanager
import torch
_was_init = False