Skip to content

Instantly share code, notes, and snippets.

View avramovic's full-sized avatar

Nemanja Avramović avramovic

View GitHub Profile
@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"
@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 / 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 / backup-db.sh
Last active October 6, 2024 20:15
Simple linux shell backup to s3 with s3cmd
#!/bin/bash
if [ -z "$1" ]
then
echo "No database name supplied, usage:"
echo $0 database
exit 1
fi
DBNAME=$1
@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 / 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)