Skip to content

Instantly share code, notes, and snippets.

View violethair's full-sized avatar
🐢
To don't need to be fast. Slowly but surely

Violet Hair violethair

🐢
To don't need to be fast. Slowly but surely
View GitHub Profile
@violethair
violethair / convertPNGtoWEBP
Created July 31, 2021 22:02
Convert PNG to WEBP folder
# Copy and paste this to PowerSell
$dir = "path_input"
$images = Get-ChildItem $dir
foreach ($img in $images) {
$outputName = 'path_output' + $img.BaseName + ".webp"
cwebp $img.FullName -q 100 -alpha_q 100 -m 6 -o $outputName
}
@violethair
violethair / install-graphicsmagic.sh
Last active February 20, 2020 08:25
Install GraphicsMagick from command-line on Ubuntu
#!/bin/sh
# Install pre-requisites
apt-get install build-essential software-properties-common libjpeg-dev libtiff5-dev libpng-dev --fix-missing
# Download from SourceForge
wget --no-cookies --timestamping https://excellmedia.dl.sourceforge.net/project/graphicsmagick/graphicsmagick/1.3.34/GraphicsMagick-1.3.34.tar.gz --directory /tmp
# Decompress package into /opt/graphicsmagick
if [ ! -d "/opt/graphicsmagick/src" ]; then
@violethair
violethair / GekkoTest.sol
Last active January 21, 2019 11:47
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js&optimize=false&gist=
pragma solidity 0.4.25;
library SafeMath {
int256 constant private INT256_MIN = -2**255;
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the