One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
// HSV to RGB code from http://www.splinter.com.au/converting-hsv-to-rgb-colour-using-c/ | |
// Other code by me | |
#r "System.Drawing"; | |
using System.Drawing; | |
void HsvToRgb(double h, double S, double V, out int r, out int g, out int b) | |
{ | |
// T. Nathan Mundhenk mundhenk@usc.edu | |
double H = h; |
for x = 0, 15 do | |
for y = 0, 15 do | |
c = string.format("%q", string.char(16 * x + y)):gsub("\"", ""):gsub("\n", "n") | |
c = string.rep(" ", 4 - #c) .. c | |
io.stdout:write(c) | |
end | |
io.stdout:write("\n") | |
end | |
--[[ OUTPUT: |
imagemagick batch convert .svg files to .png files with transperant background and higher resolution.
imagemagick: http://www.imagemagick.org/script/download.php#windows
svg files must be in a .\svg folder relative to executing path. output dir will be .\png
Powershell script:
mkdir .\png
# Powershell script to delete all empty subdirectories | |
$rootPath = Get-Location | |
foreach($childItem in (Get-ChildItem $rootPath -Recurse)) | |
{ | |
# if it's a folder AND does not have child items of its own | |
if( ($childItem.PSIsContainer) -and (!(Get-ChildItem -Recurse -Path $childItem.FullName))) | |
{ | |
# Delete it | |
Remove-Item $childItem.FullName -Confirm:$false |
#!/bin/bash | |
# Wendelstein7's Setup Script | |
# https://askubuntu.com/questions/147241/execute-sudo-without-password | |
if [ ! -f /etc/sudoers.d/$(logname) ]; then | |
sudo sh -c 'echo "$(logname) ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/$(logname)' | |
sudo chmod 440 /etc/sudoers.d/$(logname) | |
fi | |
sudo apt update |
#define isBitSet(byte, bit) ((byte) & (1 << (bit))) | |
#define setBit(byte, bit) ((byte) |= (1 << (bit))) | |
#define clearBit(byte, bit) ((byte) &= ~(1 << (bit))) | |
#define toggleBit(byte, bit) ((byte) ^= (1 << (bit))) | |
#define setBitTo(byte, bit, value) ((value) ? setBit(byte, bit) : clearBit(byte, bit)) |
# China Great Firewall hosts file | |
# This lists domains that are blocked by the 'Great Firewall' that is being used in China. | |
# Data is taken from the research conducted by https://gfwatch.org/overview | |
# Data is a snapshot of 2021-11-04 data taken from https://drive.google.com/drive/folders/1-l4o3c31BuWl6DoA2s7n3BWiEL5jN925 | |
# Converted to hosts file format with regex: `/(^[^|]+).+/` replaced with `0.0.0.0 $1` | |
# Use with pi-hole for example to simulate your own Great Firewall. | |
# 537387 entries in this file. | |
0.0.0.0 ttwt.com.cn | |
0.0.0.0 54321zm.com |
sudo apt-get install highlight | |
echo "alias cats='highlight -O ansi --force'" > ~/.bash_aliases && source ~/.bash_aliases | |
#Use: `cats <file>`, like `cats test.sh` |