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 / 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
{
/**
@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