Skip to content

Instantly share code, notes, and snippets.

View josevh's full-sized avatar

Jose V Herrera Gallegos josevh

View GitHub Profile
@josevh
josevh / alphanumeric_increment.php
Last active May 9, 2018 15:42 — forked from lewayotte/alphanumeric_increment.php
Incrementing alphanumeric strings in PHP
function alphanumeric_increment( $string, $position=false ) {
if ( false === $position ) {
$position = strlen( $string ) - 1;
}
$increment_str = substr( $string, $position, 1 );
switch ( $increment_str ) {
case '9':
$string = substr_replace( $string, 'a', $position, 1 );
break;
case 'z':
@josevh
josevh / JMXItemChecker.java
Last active August 30, 2016 08:42 — forked from Cromeshnic/JMXItemChecker.java
zabbix_java JMX LLD patch for 2.4.6. Usage example: jmx.discovery["org.apache.activemq:BrokerName=*,Type=Queue,Destination=*"]
/*
** Zabbix
** Copyright (C) 2001-2015 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,