Skip to content

Instantly share code, notes, and snippets.

View coskuntekin's full-sized avatar
:octocat:
Coding

Coskun TEKIN coskuntekin

:octocat:
Coding
View GitHub Profile
@coskuntekin
coskuntekin / compress.sh
Last active May 29, 2023 02:36
Compress folders
for dir in *; do
tar -czvf $dir.tgz --exclude='node_modules' "$dir"
done
@coskuntekin
coskuntekin / compress.sh
Created April 23, 2023 03:03
Compress JPG files in the folder
for file in *; do
convert -strip -interlace Plane -gaussian-blur 0.05 -quality 60% "$file" "$file"
done
@coskuntekin
coskuntekin / avif.sh
Created April 20, 2023 10:02
Convert to avif whole files in the folder
for file in *; do
magick convert "$file" "${file%.*}.avif"
done
@coskuntekin
coskuntekin / rename.sh
Created April 19, 2023 02:57
Rename file name to lowercase and add underscore for the spaces in the folder
#!/bin/bash
for file in *.png; do
new_file=$(echo "$file" | tr '[:upper:]' '[:lower:]' | sed 's/ /_/g')
mv "$file" "$new_file"
done
@coskuntekin
coskuntekin / resize_convert.sh
Created April 19, 2023 02:51
Resize and convert images to DPR
for file in *; do
convert "$file" -resize 96x -format webp "${file%.*}_1x.webp"
convert "$file" -resize 192x -format webp "${file%.*}_2x.webp"
convert "$file" -resize 288x -format webp "${file%.*}_3x.webp"
done
@coskuntekin
coskuntekin / settings.json
Created February 9, 2023 02:09
VSCode italic
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": [
"comment",
"variable",
"variable.other.object.js",
"variable.other.object.property",
"keyword",
"storage.type",
@coskuntekin
coskuntekin / version.js
Last active February 24, 2023 08:44
Set version number to VERSION.txt and env.production file
import { createWriteStream, readFileSync, writeFileSync } from "node:fs";
import { stdin as input, stdout as output } from "node:process";
import { execSync } from "node:child_process";
import * as readline from "node:readline/promises";
let currentSplitVersion;
let currentVersion;
let currentMajor;
let currentMinor;
let currentPatch;
@coskuntekin
coskuntekin / sticker.sh
Last active January 6, 2023 07:48
sticker.sh
#!/bin/bash
#pwd
dir="/FolderDirectory/"
echo 'Accessing folders'
cd ${dir}
for folder in *
do
cd $folder
echo 'Entering the folder' $folder
echo 'Making gif name of' $folder
@coskuntekin
coskuntekin / upload.sh
Created December 6, 2022 08:00
Upload file via SSH
tar czf - dist/ | ssh user@remote 'rm -rf folder/* && tar xfz - -C folder/ && mv folder/dist/* folder/ && rm -rf folder/dist/'
@coskuntekin
coskuntekin / image.sh
Created October 19, 2022 07:30
Convert PNG to WebP
for f in *.png ; do magick "$f" -quality 50 -define webp:lossless=true "${f%.png}.webp" ; done