Skip to content

Instantly share code, notes, and snippets.

Avatar

Frozenex frozenex

View GitHub Profile
@frozenex
frozenex / bulk-convert.sh
Created Sep 14, 2020
Bulk convert images to webp format using cwebp library in linux
View bulk-convert.sh
#!/bin/bash
# Copy this file to any directory containing images & then run this script in bash shell
# Get all png images in the current directory & convert it to webp format
for file in *.png ;
do
cwebp -q 80 "$file" -o "${file%.png}.webp";
done
@frozenex
frozenex / bulk-convert.ps1
Last active Sep 14, 2020
Bulk convert images to webp format using cwebp library in windows
View bulk-convert.ps1
# Copy this file to any directory containing images & then run this script in powershell
# Get all png images in the current directory & convert it to webp format
$images = Get-ChildItem -Path (Get-Location) -Filter *.png
foreach ($image in $images) {
$fileName = $image.DirectoryName + "\" + $image.BaseName + ".webp"
cwebp.exe -q 80 $image.FullName -o $fileName
}
@frozenex
frozenex / gitlab-runner.sh
Last active Sep 29, 2019
Gitlab Runner Docker Container
View gitlab-runner.sh
#!/bin/bash
docker run -d \
--name gitlab-runner \
--restart always \
-v /srv/gitlab-runner/config:/etc/gitlab-runner \
-v /var/run/docker.sock:/var/run/docker.sock \
gitlab/gitlab-runner:alpine
read -p "Enter gitlab runner registration-token: " TOKEN
@frozenex
frozenex / AadhaarUtil.kt
Created Jun 23, 2018
Aadhaar Number Validation in Kotlin
View AadhaarUtil.kt
/**
* Validate aadhaar number using verhoeff algorithm
* Created by Frozenex
*/
class AadhaarUtil {
companion object {
private val d by lazy {
arrayOf(intArrayOf(0, 1, 2, 3, 4, 5, 6, 7, 8, 9),