Skip to content

Instantly share code, notes, and snippets.

View pmgupte's full-sized avatar
🏠
Working from home 👨‍💻

Prabhas Gupte pmgupte

🏠
Working from home 👨‍💻
View GitHub Profile
@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,
@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
@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,
@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);
?>
@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 / 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

@pmgupte
pmgupte / sites.geojson
Last active August 29, 2015 14:06
some sites and their server locations
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pmgupte
pmgupte / array_in_array.php
Last active December 27, 2015 15:59
PHP function to check whether all elements from one array are present in another array.
<?php
/**
* Check whether all elements from $needle array are present in $haystack array.
* Works for single-dimentional arrays only.
* If you use multi-dimentional arrays, result could be misterious.
* @param array $needle
* @param array $haystack
* @return boolean true if all elements in $needle are found in $haystack. false otherwise.
*/
function array_in_array($needle, $haystack) {
Programming Laguages
PHP - currenly my bread and butter is earned with this language only
Javascript
Ruby
Editors
Eclipse, with PDT - on ubuntu as well as windows. This is my preferred editor
vim - only when working on terminal
nodepad++ - only when working on windows
Sublime Text 2 - trying this editor on linux as well as windows
Source Code Control