Skip to content

Instantly share code, notes, and snippets.


Nemanja Avramović avramovic

View GitHub Profile
avramovic / PasswordValidator.php
Last active Mar 24, 2021
Laravel 5+ password validation rules
View PasswordValidator.php
namespace App\Validators;
class PasswordValidator
public function validateLetters($attribute, $value)
return preg_match('/\pL/', $value);
avramovic /
Last active Dec 1, 2020
Clean up merged Git branches
#!/usr/bin/env bash
if [ ! -d .git ]; then
echo "Not a git repository!"
exit 1
currentBranch=`git status | grep "On branch" | awk '{ print $3 }'`
echo "You are on branch:" $currentBranch
avramovic /
Created Dec 10, 2019
Simple linux shell backup to s3 with s3cmd
#!/usr/bin/env bash
SQLDUMP="$1_db_$(date +'%Y%m%d%H%M').sql.gz"
echo "Creating backup of database to $SQLDUMP..."
/usr/bin/mysqldump --login-path=local --databases $1 | gzip -9 > $SQLDUMP
echo "Uploading zipped dump to the Amazon S3 bucket..."
/usr/bin/s3cmd put $SQLDUMP s3://your.s3.bucket.hostname/database/$SQLDUMP
echo "Removing the backup file $SQLDUMP"
avramovic / proof.txt
Last active Aug 12, 2020
Twinery sidebar stats
View proof.txt
Simple sidebar
The beginning
(set: $money to 500)
You came to the lake and have some money with you. Stamina is irrelevant right now.
avramovic / overnewser.user.js
Created Sep 7, 2017
Google Chrome userscript to skip annoying countdown
View overnewser.user.js
* To install, save this file as overnewser.user.js and drag/drop it into your chrome://extensions page
// ==UserScript==
// @name UnderNewser
// @description Skip annoying waiting time
// @namespace
// @author Nemanja (