Skip to content

Instantly share code, notes, and snippets.

View BillyPurvis's full-sized avatar

Billy Purvis BillyPurvis

View GitHub Profile
@BillyPurvis
BillyPurvis / commit-msg.sh
Created July 18, 2018 22:39
A commit-msg hook written with bash to stop badly worded commits!
#!/bin/sh
shopt -s nocasematch # Case insensitive matching
shopt -s extglob
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m'
regex='^(fix(es)?|change(s)?|merge(s)?|update(s)?|add(s)?|remove(s)?)[[:space:]].+[a-zA-Z?!${}()@].'
# Get commit Message
@BillyPurvis
BillyPurvis / Jenkinsfile
Last active May 1, 2022 02:34
Jenkinsfile Boomerang Finished
String branchName = env.BRANCH_NAME
String gitCredentials = "CREDENTIAL_ID"
String repoUrl = "https://github.com/username/repo-name.git"
// Emails
String devEmails = "[email protected], [email protected]"
String qaEmauls = "[email protected], [email protected]"
// Server Credentials ID
String sshCredentials = "" // Defaults to empty to avoid accidental releases
@BillyPurvis
BillyPurvis / Jenkinsfile
Created July 2, 2018 21:05
Jenkins With Email Notifications
String branchName = env.BRANCH_NAME
String gitCredentials = "CREDENTIAL_ID"
String repoUrl = "https://github.com/username/repo-name.git"
// Server Credentials ID
String sshCredentials = "" // Defaults to empty to avoid accidental releases
String devServerCredentials = "CREDENTIAL_ID"
String stagingCredentials = "CREDENTIAL_ID"
String productionCredentials = "CREDENTIAL_ID"
@BillyPurvis
BillyPurvis / Jenkinsfile
Last active July 2, 2018 21:01
Support Multiple Servers Jenkins
String branchName = env.BRANCH_NAME
String gitCredentials = "CREDENTIAL_ID"
String repoUrl = "https://github.com/username/repo-name.git"
// Server Credentials ID
String sshCredentials = "" // Defaults to empty to avoid accidental releases
String devServerCredentials = "CREDENTIAL_ID"
String stagingCredentials = "CREDENTIAL_ID"
String productionCredentials = "CREDENTIAL_ID"
@BillyPurvis
BillyPurvis / Jenkinsfile
Last active July 2, 2018 20:57
Full Build Stages Jenkinsfile
String branchName = env.BRANCH_NAME
String gitCredentials = "CREDENTIAL_ID"
String repoUrl = "https://github.com/username/repo-name.git"
// Server Credentials ID
String testCredentials = "CREDENTIAL_ID"
String ip = "127.0.0.1" // Server IP goes here
String usr_dir = "example" // Server user and path
node {
@BillyPurvis
BillyPurvis / Jenkinsfile
Last active January 14, 2024 18:40
A Basic Jenkins Scripted Pipeline Github Clone Repo Stage
String branchName = env.BRANCH_NAME
String gitCredentials = "CREDENTIAL_ID"
String repoUrl = "https://github.com/username/repo-name.git"
node {
// Start Stages
stage('Clone') {
// Clones the repository from the current branch name
echo 'Make the output directory'
sh 'mkdir -p build'
package handler
import (
"encoding/json"
"fmt"
"net/http"
"github.com/julienschmidt/httprouter"
ldap "gopkg.in/ldap.v2"
)
@BillyPurvis
BillyPurvis / gulpfile.js
Last active December 24, 2015 22:04
Jekyll Boilerplate Gist
/*jslint node: true */
var gulp = require('gulp'),
sass = require('gulp-sass'),
util = require('gulp-util'),
spawn = require('child_process').spawn,
rename = require('gulp-rename'),
uglify = require('gulp-uglify'),
connect = require('gulp-connect'),
runSequence = require('gulp-run-sequence'),