Skip to content

Instantly share code, notes, and snippets.

View avramovic's full-sized avatar

Nemanja Avramović avramovic

View GitHub Profile
@avramovic
avramovic / overnewser.user.js
Created September 7, 2017 23:11
Google Chrome userscript to skip annoying overnewser.com countdown
/**
* To install, save this file as overnewser.user.js and drag/drop it into your chrome://extensions page
*/
// ==UserScript==
//
// @name UnderNewser
// @description Skip annoying overnewser.com waiting time
// @namespace http://www.avramovic.info
// @author Nemanja (http://twitter.com/avramator)
@avramovic
avramovic / proof.txt
Last active August 12, 2020 08:08
Twinery sidebar stats
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
avramovic / backup-db.sh
Created December 10, 2019 10:06
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
avramovic / gitclean.sh
Last active March 28, 2024 08:44
Clean up merged Git branches
#!/usr/bin/env bash
if [ ! -d .git ]; then
echo "Not a git repository!"
exit 1
fi
currentBranch=`git status | grep "On branch" | awk '{ print $3 }'`
echo "You are on branch:" $currentBranch
@avramovic
avramovic / PasswordValidator.php
Last active March 24, 2021 18:02
Laravel 5+ password validation rules
<?php
namespace App\Validators;
class PasswordValidator
{
public function validateLetters($attribute, $value)
{
return preg_match('/\pL/', $value);
}
@avramovic
avramovic / newrelic.config
Created May 18, 2022 13:29
New Relic PHP agent (v9.21) on AWS Elastic Beanstalk AMI Linux 2 (arm based cpu)
files:
"/etc/httpd/conf.modules.d/11-mpm.conf":
mode: "000755"
owner: root
group: root
content: |
LoadModule mpm_event_module modules/mod_mpm_event.so
"/etc/php.d/20-newrelic.ini":
mode: "000755"