Skip to content

Instantly share code, notes, and snippets.

View samdunne's full-sized avatar

Sam Dunne samdunne

View GitHub Profile
@pragmaticivan
pragmaticivan / Jenkinsfile
Created March 22, 2018 19:20 — forked from jonico/Jenkinsfile
Example for a full blown Jenkins pipeline script with multiple stages, input steps, injected credentials, heroku deploy, sonarqube and artifactory integration, multiple Git commit statuses, PR merge vs branch build detection, REST API calls to GitHub deployment API, stage timeouts, stage concurrency constraints, ...
#!groovy
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
/*
Please make sure to add the following environment variables:
HEROKU_PREVIEW=<your heroku preview app>
HEROKU_PREPRODUCTION=<your heroku pre-production app>
HEROKU_PRODUCTION=<your heroku production app>
@jonico
jonico / Jenkinsfile
Last active January 31, 2024 09:43
Example for a full blown Jenkins pipeline script with CodeQL analysis steps, multiple stages, Kubernetes templates, shared volumes, input steps, injected credentials, heroku deploy, sonarqube and artifactory integration, Docker containers, multiple Git commit statuses, PR merge vs branch build detection, REST API calls to GitHub deployment API, …
#!groovy
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
def label = "mypod-${UUID.randomUUID().toString()}"
podTemplate(label: label, yaml: """
spec:
containers:
- name: mvn
image: maven:3.3.9-jdk-8
#!/usr/bin/python
import sys
import boto.sts
import boto.s3
import boto.iam
import requests
import getpass
import ConfigParser
import base64
@chinshr
chinshr / Jenkinsfile
Last active October 16, 2023 09:25
Best of Jenkinsfile, a collection of useful workflow scripts ready to be copied into your Jenkinsfile on a per use basis.
#!groovy
# Best of Jenkinsfile
# `Jenkinsfile` is a groovy script DSL for defining CI/CD workflows for Jenkins
node {
}
@tevino
tevino / fix_virtualenv
Last active March 24, 2024 09:41
Fix python virtualenv after python update
#!/usr/bin/env bash
ENV_PATH="$(dirname "$(dirname "$(which pip)")")"
SYSTEM_VIRTUALENV="$(which -a virtualenv|tail -1)"
BAD_ENV_PATHS="/usr/local"
echo "Ensure the root of the broken virtualenv:"
echo " $ENV_PATH"
/*
* Copyright 2014 Chef Software, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@cyrille-leclerc
cyrille-leclerc / workflow.groovy
Created November 5, 2014 14:58
W-JAX 14- Pimp Your Continuous Delivery Pipeline with the New Jenkins Workflow Engine
def qaCatalinaBase = '/opt/apache-tomcat-8-qa'
def qaHttpPort = 8081
def stagingCatalinaBase = '/opt/apache-tomcat-8-staging'
def stagingHttpPort = 8082
def perfsCatalinaBase = '/opt/apache-tomcat-8-perfs'
def perfsHttpPort = 8084
def productionCatalinaBase = '/opt/apache-tomcat-8-production'
@biomancer
biomancer / dep_detect.rb
Last active March 20, 2017 16:04
Dirty simple order dependencies detector
## This script can be used to detect simple order dependencies if one of tests is failing when some other test(or tests, independently) is being run before it.
## Script will not give reliable results if the dependency is complex - e.g. two specific tests must be run before for affected one to fail.
## Script will refine results with each rspec run: more runs will result smaller UNSAFE lists. Files from previous script runs are used too
## Ensure that you have config.order = 'random' in RSpec.configure block .
## Running rspec with different seeds to collect data
RSPEC_RUN_COUNT = 5 #set to 0 to analyze already existing rspec_*.txt files
RSPEC_RUN_COUNT.times do
@soheilhy
soheilhy / nginxproxy.md
Last active March 22, 2024 08:54
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@antoniolg
antoniolg / SwipeRefreshActivity.java
Last active July 29, 2019 11:59
An activity that uses a SwipeRefreshLayout as a container for the layout of the classes that extend it.
/*
* Copyright (C) 2014 Antonio Leiva Gordillo.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software