Skip to content

Instantly share code, notes, and snippets.

Avatar

Dalibor Sojic dalibor-sojic

View GitHub Profile
View telegram-send.sh
#!/bin/bash
GROUP_ID="xxxx"
BOT_TOKEN="xxxx"
# this 3 checks (if) are not necessary but should be convenient
if [ "$1" == "-h" ]; then
echo "Usage: `basename $0` \"text message\""
exit 0
fi
View gist:a61ee6bd36d6aca3558d2391a4d48f10
<?php
namespace App\Helpers;
use Sunra\PhpSimple\HtmlDomParser;
class UJPCrawler
{
@dalibor-sojic
dalibor-sojic / optimize-images.sh
Last active Nov 9, 2019
Optimize images on upload with inotify and jpgoptim
View optimize-images.sh
#!/usr/bin/env
MONITORDIR="/home/_______/public_html/wp-content/uploads/"
inotifywait -m -r -e create --format '%w%f' "${MONITORDIR}" | while read NEWFILE
do
jpegoptim --strip-all ${NEWFILE}
done
View maticen.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>
</title>
</head>