Skip to content

Instantly share code, notes, and snippets.

View jeffreyvr's full-sized avatar
🎸
Freelancing and building my own stuff.

Jeffrey van Rossum jeffreyvr

🎸
Freelancing and building my own stuff.
View GitHub Profile
@jeffreyvr
jeffreyvr / locations.json
Created October 10, 2017 10:38
Google Maps Center Map based on Markers (json)
[{"name":"Villa del Balbianello","address":"via comoedia, 5, 22016 Tremezzina CO, Italy","lat":"45.9661118","lng":"9.2011346"},{"name":"Cortina d'Ampezzo","address":"Cortina d'Ampezzo, Italy","lat":"46.5396066","lng":"12.1343257"},{"name":"Museo della Civilt\u00e0 Romana","address":"Piazza Giovanni Agnelli, 10, 00144 Roma RM, Italy","lat":"41.8308835","lng":"12.4751877"},{"name":"Villa di Fiorano","address":"Via Appia Antica, 400, 00178 Roma RM, Italy","lat":"41.7991554","lng":"12.573976"},{"name":"Hotel Danieli","address":"Castello, 4196, 30122 Venezia VE, Italy","lat":"45.4338669","lng":"12.3399006"},{"name":"Hotel Cala Di Volpe","address":"Costa Smeralda, 07020 Porto Cervo, OT, Italy","lat":"41.0902363","lng":"9.5387878"}]
@jeffreyvr
jeffreyvr / LogFailedAuthenticationAttempt.php
Last active July 24, 2017 06:25
Add WordPress password validation to Laravel
<?php
namespace App\Listeners;
use Illuminate\Auth\Events\Failed;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use App\User as User;
use MikeMcLin\WpPassword\Facades\WpPassword;
use Auth;
@jeffreyvr
jeffreyvr / simple-html-dom.php
Last active March 21, 2017 19:06
Simple WordPress plugin to replace images with the .Sirv css class (for Boagworld)
<?php
/**
* Website: http://sourceforge.net/projects/simplehtmldom/
* Additional projects that may be used: http://sourceforge.net/projects/debugobject/
* Acknowledge: Jose Solorzano (https://sourceforge.net/projects/php-html/)
* Contributions by:
* Yousuke Kumakura (Attribute filters)
* Vadim Voituk (Negative indexes supports of "find" method)
* Antcs (Constructor with automatically load contents either text or file/url)
*
@jeffreyvr
jeffreyvr / class-single-post-meta-manager-loader.php
Last active March 1, 2017 10:23
Defining priority and arguments to Single Post Meta Manager Loader class.
<?php
/**
* This class is based on the loader class from this tutorial;
* https://code.tutsplus.com/tutorials/object-oriented-programming-in-wordpress-document-the-plugin-ii--cms-21167
*
* In this example I have added the ability to define the priority and arguments for actiond and filters.
*/
class Single_Post_Meta_Manager_Loader {
protected $actions;
@jeffreyvr
jeffreyvr / wp-recount-comments.php
Created April 1, 2015 10:51
WordPress recount comments
<?php
/**
* Put this file in the root of your WordPress installation.
* When done remove it!
*/
include 'wp-blog-header.php';
global $wpdb;
@jeffreyvr
jeffreyvr / validate-dutch-phone-number-function.php
Created March 19, 2015 13:47
Validate Dutch Phone Number
<?php
/**
* Validate Dutch Phone number
*
* Can be a local or mobile phone number.
*/
function validate_dutch_phone_number( $phone_number ){
if ( preg_match( "/^(\+|00|0)(31\s?)?(6[\s-]?[1-9][0-9]{7}|[1-9][0-9][\s-]?[1-9][0-9]{6}|[1-9][0-9]{2}[\s-]?[1-9][0-9]{5})$/", $phone_number ) ) {
return true;
} else {