Skip to content

Instantly share code, notes, and snippets.

View ghermans's full-sized avatar

Glenn Hermans ghermans

View GitHub Profile
@ghermans
ghermans / iban.js
Created August 19, 2021 23:57 — forked from martijnluinstra/iban.js
Dutch IBAN generator
/**
* Javascript Generator for Dutch IBANs.
* Demo: projects.martijnluinstra.nl/iban/
* Dependencies: https://github.com/MikeMcl/bignumber.js/
*
* Copyright (c) 2017 - Martijn Luinstra
*/
/**
* Converts IBAN to the decimal representation used for validation
@ghermans
ghermans / categories.blade.php
Created July 8, 2020 18:53
Get all categories in Bagisto
@php
$categories = [];
foreach (app('Webkul\Category\Repositories\CategoryRepository')->getVisibleCategoryTree(core()->getCurrentChannel()->root_category_id) as $category) {
if ($category->slug)
array_push($categories, $category);
}
@endphp
<ul>
@ghermans
ghermans / ScheduleList.php
Created February 19, 2020 01:32 — forked from M165437/ScheduleList.php
PHP Artisan command that lists all scheduled tasks: php artisan schedule:list (Credit: https://stackoverflow.com/a/35559970/2714126)
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Console\Scheduling\Schedule;
class ScheduleList extends Command
{
/**

Description

This will explain how you can change the clothes for your players ped.
You can find an example here.

SetPedComponentVariation(Ped ped, int componentId, int drawableId, int textureId, int paletteId) 
  • Ped - is the ped you want to set the outfit.
@ghermans
ghermans / pedrelationship.md
Last active March 27, 2023 01:54
FiveM Ped Relations
Relationship hash name Like Dislike Respect Hate
ARMY ARMY COP
AGGRESSIVE_INVESTIGATE HATES_PLAYER
AGGRESSIVE_INVESTIGATE
PLAYER
AMBIENT_GANG_BALLAS AMBIENT_GANG_BALLAS
GUARD_DOG
AMBIENT_GANG_CULT AMBIENT_GANG_CULT
GUARD_DOG
AMBIENT_GANG_FAMILY AMBIENT_GANG_FAMILY
GUARD_DOG
AMBIENT_GANG_LOST AMBIENT_GANG_LOST
GUARD_DOG
AMBIENT_GANG_MARABUNTE AMBIENT_GANG_MARABUNTE
GUARD_DOG
AMBIENT_GANG_MEXICAN AMBIENT_GANG_MEXICAN GUARD_DOG
@ghermans
ghermans / MailCheck.php
Created November 23, 2016 21:25
Laravel IMAP Mail Sync
<?php
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class MailCheck extends Command {
/**
* The console command name.
@ghermans
ghermans / App\Exceptions\Handler.php
Created October 24, 2016 06:36 — forked from jacurtis/App\Exceptions\Handler.php
How to get filp/whoops to work in Laravel 5.2 or 5.3 - Add this code to your `App\Exceptions\Handler.php` file.
/**
* Create a Symfony response for the given exception.
*
* @param \Exception $e
* @return mixed
*/
protected function convertExceptionToResponse(Exception $e)
{
if (config('app.debug')) {
$whoops = new \Whoops\Run;
@ghermans
ghermans / node-and-npm-in-30-seconds.sh
Created February 24, 2016 03:57 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
Inorder to change default document root for a domain hosted in a plesk control panel we need to create vhost.conf file in the directory in which http.include for the domain resides. Directly changing the document root entry in httpd.include causes the modification to be overwritten with default entry since plesk overwrites entries in configuration files with database entries
Entries to be put in the vhost.conf follows
DocumentRoot /path/to/your/new/root
<Directory /path/to/your/new/root>
# Put this if you really need all options?
Options Indexes ExecCGI FollowSymLinks MultiViews
AddHandler cgi-script .cgi
# are you using .htaccess files? if not, set it from all to none
AllowOverride all
@ghermans
ghermans / psa_snippet.txt
Created January 3, 2016 20:47
Fix for Awstats Plesk Ubuntu
# AWStats
AWSTATS_ETC_D /etc/awstats
AWSTATS_BIN_D /usr/lib/cgi-bin
AWSTATS_TOOLS_D /usr/share/awstats/tools
AWSTATS_DOC_D /var/www/html/awstats