Skip to content

Instantly share code, notes, and snippets.

View avramovic's full-sized avatar

Nemanja Avramović avramovic

View GitHub Profile
@a-h-abid
a-h-abid / ValidationResponseWithRuleName.php
Last active March 17, 2023 08:19
Laravel Validation Response for API with Rule Key
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
class ValidationResponseWithRuleName
{
/**
@milankragujevic
milankragujevic / brojsrpski.php
Last active November 28, 2019 09:35
PHP funkcija koja pretvara broj u slovni zapis broja (234 => dvestotinetridesetčetiri).
<?php
/*
* Autor: Vukašin Ćirić (shadow-bg)
* Pod pretpostavkom da je objavljeno u public domain ili pod FOSS-kompatibilnom licencom
* https://www.elitesecurity.org/p3369017
*/
function brojsrpski($para) {
$broj = number_format($para, 2, ',', '.');
if(strpos($broj, ",")) {
list($dinara, $para) = explode(",", $broj);
@giovanni-d
giovanni-d / allinonemigration.md
Last active May 10, 2024 21:19
All-in-One WP Migration - Restore From Server (without PRO version) - Restore

All-in-One WP Migration Restore From Server (without pro version)

If you don't want to pay for the PRO version of this plugin, and you want to use the "Restore from Server" functionally that was present in the version 6.77, follow the instructions below:

  1. Open the js file: wp-content/plugins/all-in-one-wp-migration/lib/view/assets/javascript/backups.min.js
  2. On line 1208, replace the code below:
$('.ai1wm-backup-restore').click(function (e) {
@SohanChy
SohanChy / logging.php
Created May 12, 2019 08:58
Configuring Laravel for JSON Logging Using Monolog (For Kibana)
...
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => ['single'],
],
'single' => [
'driver' => 'monolog',
'path' => storage_path('logs/laravel.log'),
@thiagosf
thiagosf / gist:eb2ba7d24968873e745c61d2ee72c0d8
Last active September 25, 2023 10:44
Export ERD (diagrams) from SequelPro

Export ERD (diagrams) from SequelPro

Install graphviz

sudo brew install graphviz

Open SequelPro, choose database and export dot file. Now, run the command:

@sebastiandero
sebastiandero / autoexec.cfg
Last active September 28, 2023 23:35
Autoexec.cfg for CS:GO
//~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--
//
//.----------------. .----------------. .----------------. .----------------. .----------------. .----------------. .----------------.
//| .--------------. || .--------------. || .--------------. || .--------------. || .--------------. || .--------------. || .--------------. |
//| | ________ | || | _________ | || | ____ ____ | || | _________ | || | ____ ____ | || | _ | || | _______ | |
//| | |_ ___ `. | || | |_ ___ | | || ||_ _| |_ _| | || | |_ ___ | | || | |_ _||_ _| | || | | | | || | / ___ | | |
//| | | | `. \ | || | | |_ \_| | || | \ \ / / | || | | |_ \_| | || | \ \ / / | || | \_| | || | | (__ \_| | |
//| | | | | | | || | | _| _ | || | \ \ / / | || | | _| _ | || | > `' < | || | | || | '.___`-. | |
//| | _| |___.'
@Faryshta
Faryshta / ubuntu-php7-install.sh
Last active March 12, 2021 23:08
Ubuntu 14.04 PHP7 (Install from Source)
#!/bin/bash
# Install Dependencies
apt-get install --reinstall make;
apt-get update;
apt-get install --yes \
git \
# supervisor
#
# Author: Günter Grodotzki <gunter@grodotzki.co.za>
# Version: 2015-04-25
#
# - set param "SUPERVISE=enable" to activate
# - chmod +x supervise.sh
#
packages:
yum:
@stefanzweifel
stefanzweifel / slack.php
Created May 8, 2014 13:26
Slack.com Webhook Integration (PHP) - Simple snippet which tells you, how to build your payload array.
<?php
//Options
$token = 'YOUR_TOKEN_HERE';
$domain = 'YOUR_SLACK_DOMAIN_GOES_HERE';
$channel = '#general';
$bot_name = 'Webhook';
$icon = ':alien:';
$message = 'Your message';