Skip to content

Instantly share code, notes, and snippets.

View djom202's full-sized avatar

Jonathan Olier djom202

View GitHub Profile
@ivan-pinatti
ivan-pinatti / jenkins-set-number-of-executors.groovy
Last active October 31, 2019 20:27
Jenkins - Set number of executors via groovy script - #jenkins #groovy
#!groovy
// imports
import jenkins.model.Jenkins
// parameter
Integer numberOfExecutors = 2
// get Jenkins instance
Jenkins jenkins = Jenkins.getInstance()
@adambarthelson
adambarthelson / nmea2gps.js
Created April 23, 2015 19:44
Convert NMEA GPS data from decimal-decimal format to decimal-degree
function NMEA2GPS(num, pole){
var poles = {'N':1,'S':-1,'W':-1,'E':1};
var s = parseFloat(num).toString();
var deg = s.substring(0,2);
var min = s.substring(2);
return (parseInt(deg) + parseFloat(min)/60) * poles[pole];
}
// NMEA2GPS(07721.2060, 'W') => -77.35347
@timonweb
timonweb / gist:3165322
Created July 23, 2012 18:38
Code to catch all PHP errors which result in 500 Error Code. Include this snippet at the beginning of index.php file
<?php
define('E_FATAL', E_ERROR | E_USER_ERROR | E_PARSE | E_CORE_ERROR |
E_COMPILE_ERROR | E_RECOVERABLE_ERROR);
define('ENV', 'dev');
//Custom error handling vars
define('DISPLAY_ERRORS', TRUE);
define('ERROR_REPORTING', E_ALL | E_STRICT);