Skip to content

Instantly share code, notes, and snippets.

View pmgupte's full-sized avatar
🤠
busy! I may be slow to respond.

Prabhas Gupte pmgupte

🤠
busy! I may be slow to respond.
View GitHub Profile
@pmgupte
pmgupte / sublime_text_2_trim_whitespaces.md
Last active August 29, 2015 14:07
Sublime Text 2: Trim trailing white spaces on save

Go to SublimeText 2 > Preferences > User Settings. This should open your User Settings as a JSON file. Add the following to your file:

"trim_trailing_white_space_on_save": true

@tronsha
tronsha / installphp7.sh
Last active October 13, 2023 00:13
Install PHP7 to Ubuntu
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
apt-get update
apt-get install -y git-core autoconf bison libxml2-dev libbz2-dev libmcrypt-dev libcurl4-openssl-dev libltdl-dev libpng-dev libpspell-dev libreadline-dev make
mkdir -p /etc/php7/conf.d
mkdir -p /etc/php7/cli/conf.d
mkdir /usr/local/php7
@pmgupte
pmgupte / xml_to_array.php
Last active August 29, 2015 14:20
PHP one-liner to convert XML into Array
<?php
$arr = json_decode(json_encode(simplexml_load_string($xml, null, LIBXML_NOCDATA)), true);
?>
@pmgupte
pmgupte / chunkIPRange.php
Last active October 6, 2016 07:04
PHP function to chunk the given IP address range into multiple ranges of given size.
<?php
/**
* Copyright (C) 2016 Prabhas Gupte
*
* This is free script: 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 3 of the License, or
* (at your option) any later version.
*
* This script is distributed in the hope that it will be useful,
@michaellihs
michaellihs / jenkins-plugin-licenses.md
Created April 12, 2018 09:35
Get Jenkins Plugin licenses

Get List of Jenkins Plugin Licenes

The following script provides you the licences of Jenkins plugins (e.g. for Open Source compliance checks) read from their pom.xml file on the respective Github repository.

Before using the script, you have to

  1. replace your.jenkins.host.com with the domain of your Jenkins server
  2. create a Jenkins API token for your user and put it into ~/.jenkins-api-token
@nancystodd
nancystodd / Client Script-Open GlideOverlay Window to Submit or Update Another Record.js ServiceNow Client Script GlideOverlay: Open GlideOverlay Window to Submit or Update Another Record.js
// opens a new u_error_reporting record from an sc_task record
function openOverlay(overlayID, overlayTitle, iframeURI, height, width) {
// Instantiate the GlideOverlay
// Note: GlideOverlay extends GlideBox, which contains the close() method
var overlayWindow = new GlideOverlay({
id: overlayID,
title: overlayTitle,
iframe: iframeURI,
allowOverflowX: true,
closeOnEscape: true,