Skip to content

Instantly share code, notes, and snippets.

@notshi
notshi / LICENSE
Last active April 12, 2022 20:41
dQuery documentation and recipes
MIT License
Copyright (c) 2021 shi Blank
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@notshi
notshi / invaded.fun.lua
Created September 30, 2017 18:16 — forked from xriss/invaders.fun.lua
Invading the space invader
local wstr=require("wetgenes.string")
local chatdown=require("wetgenes.gamecake.fun.chatdown") -- conversation trees
local bitdown=require("wetgenes.gamecake.fun.bitdown") -- ascii to bitmap
local chipmunk=require("wetgenes.chipmunk") -- 2d physics https://chipmunk-physics.net/
-----------------------------------------------------------------------------
--[[#hardware
local wstr=require("wetgenes.string")
local chatdown=require("wetgenes.gamecake.fun.chatdown") -- conversation trees
local bitdown=require("wetgenes.gamecake.fun.bitdown") -- ascii to bitmap
local chipmunk=require("wetgenes.chipmunk") -- 2d physics https://chipmunk-physics.net/
-----------------------------------------------------------------------------
--[[#hardware
@notshi
notshi / 2017-07-24.md
Last active September 21, 2018 17:18
IATI snapshots (manual) from http://d-portal.org/ctrack.html#view=dash

Last updated 2017-07-24T18:49:48.000Z

Total Publishers 606
Total Activities 681,594
Total Countries 432

Reporting 24,191 activities with invalid recipients

@notshi
notshi / resize_imagemagick
Last active April 29, 2024 16:41
Resize ALL images using ImageMagick
#!/bin/sh
# resize_imagemagick
# resizes all images in current directory to a fixed width, keeps height ratio
# for fixed height, do x150 or both widthxheight
# runs pngquant to optimise images (aptitude install pngquant)
# save as *.* do a chmod +x and execute
for filename in *.png; do
convert $filename -resize 150 resized/$filename
pngquant --verbose --force --ext .png resized/$filename
done
@notshi
notshi / svg2png_inkscape
Last active August 29, 2015 13:57
Converts SVG to PNG using Inkscape cl
#!/bin/sh
# svg2png_inkscape
# covert all SVG to PNG in current directory
# save as *.* do a chmod +x and execute
for i in *.svg; do inkscape $i --export-png=`echo $i | sed -e 's/svg$/png/'`; done
@notshi
notshi / lowerit
Created March 25, 2014 14:33
Converts UPPERCASE to lowercase
#!/bin/sh
# lowerit
# convert all file names in the current directory to lower case
# only operates on plain files--does not change the name of directories
# will ask for verification before overwriting an existing file
# save as *.* do a chmod +x and execute
for x in `ls`
do
if [ ! -f $x ]; then
continue