Skip to content

Instantly share code, notes, and snippets.

View Jono20201's full-sized avatar
🏠
Working from home

Jonathan Martin Jono20201

🏠
Working from home
View GitHub Profile
@Jono20201
Jono20201 / gist:5ad933a31fa677d14a557f9642697375
Created February 20, 2023 12:08
Branch Policy Min Reviewers Pulumi Alt.
var createAndUpdateCommand = args.AzureRepository.Apply(
r => $@"
$policy = az repos policy list --repository-id {r.Id} --branch {r.DefaultBranch} --detect false --project {r.ProjectId} --organization https://dev.azure.com/XXXXXX | Out-String | ConvertFrom-Json | Where-Object {{ $_.type.displayName -eq 'Minimum number of reviewers' }} | Select-Object -Property id;
if([string]::IsNullOrEmpty($policy.id)) {{
az repos policy approver-count create --allow-downvotes false `
--blocking true `
--branch {r.DefaultBranch} `
--creator-vote-counts false `
--enabled true `
@Jono20201
Jono20201 / Retrieve Variables from Jenkins
Created June 21, 2020 10:32 — forked from midnite81/Retrieve Variables from Jenkins
A script to retrieve variables from Jenkins
import com.cloudbees.plugins.credentials.*;
import com.cloudbees.plugins.credentials.domains.Domain;
import org.jenkinsci.plugins.plaincredentials.impl.FileCredentialsImpl;
println "Jenkins credentials config file location=" + SystemCredentialsProvider.getConfigFile();
println ""
def fileName = "<nameOfFile>" // e.g appsettings.Development.json
SystemCredentialsProvider.getInstance().getCredentials().stream().
sudo service mysqld stop
sudo yum -y erase mysql-config mysql55-server mysql55-libs mysql55
sudo yum -y install mysql57-server mysql57
sudo service mysqld start
sudo yum -y install php71 php71-cli php71-common php71-devel php71-mysqlnd php71-pdo php71-xml php71-gd php71-intl php71-mbstring php71-mcrypt php71-opcache php71-pecl-apcu php71-pecl-imagick php71-pecl-memcached php71-pecl-redis php71-pecl-xdebug
sudo alternatives --set php /usr/bin/php-7.1
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/bin/composer
@Jono20201
Jono20201 / EEScaper.user.js
Last active February 20, 2017 09:15
EE Data Usage Scaper
// ==UserScript==
// @name EE Scaper
// @namespace http://jono20201.com/
// @version 0.1
// @description Collate information about EE data plans
// @author Jonathan Martin
// @include https://myaccount.ee.co.uk/*
// @grant unsafeWindow
// @grant GM_setValue
// @grant GM_getValue
@Jono20201
Jono20201 / PSR2 + Arrays.xml
Last active April 20, 2017 13:56
PSR2 + Arrays.xml
<code_scheme name="PSR2 + Arrays">
<PHPCodeStyleSettings>
<option name="ALIGN_KEY_VALUE_PAIRS" value="true" />
<option name="ALIGN_PHPDOC_PARAM_NAMES" value="true" />
<option name="ALIGN_PHPDOC_COMMENTS" value="true" />
<option name="ALIGN_ASSIGNMENTS" value="true" />
<option name="COMMA_AFTER_LAST_ARRAY_ELEMENT" value="true" />
<option name="PHPDOC_BLANK_LINES_AROUND_PARAMETERS" value="true" />
<option name="PHPDOC_WRAP_LONG_LINES" value="true" />
<option name="LOWER_CASE_BOOLEAN_CONST" value="true" />
@Jono20201
Jono20201 / Gulpfile.js
Created August 11, 2016 14:49
Complex-ish Elixir build script.
var elixir = require('laravel-elixir'),
glob = require('glob'),
i;
Elixir.config.notifications = false;
var cssBuildPath = "public/css-build/",
jsBuildPath = "public/js-build/";
var lessFiles = glob.sync("*", {