Skip to content

Instantly share code, notes, and snippets.

View jonespm's full-sized avatar
🥊
"Sometimes you get the bug, sometimes the bug gets lucky!"

Code Hugger (Matthew Jones) jonespm

🥊
"Sometimes you get the bug, sometimes the bug gets lucky!"
View GitHub Profile
@ivan-pinatti
ivan-pinatti / jenkins-set-url-and-email.groovy
Last active September 22, 2023 20:20
Jenkins - Set URL and email via groovy script - #jenkins #groovy
#!groovy
// imports
import jenkins.model.Jenkins
import jenkins.model.JenkinsLocationConfiguration
// parameters
def jenkinsParameters = [
email: 'Jenkins Admin <admin@jenkins.com>',
url: 'https://ci.jenkins.com:8083/'
@obskyr
obskyr / stream_response.py
Last active April 2, 2024 09:53
How to stream a requests response as a file-like object.
# -*- coding: utf-8 -*-
import requests
from io import BytesIO, SEEK_SET, SEEK_END
class ResponseStream(object):
def __init__(self, request_iterator):
self._bytes = BytesIO()
self._iterator = request_iterator
@n-st
n-st / .bash_profile
Created May 29, 2016 12:04
Start zsh from bashrc. Useful when you can't use chsh or when the same LDAP account is used both on systems with zsh installed and ones without.
# .bash_profile is executed for login shells,
# .bashrc is executed for interactive non-login shells.
# We want the same behaviour for both, so we source .bashrc from .bash_profile.
# Also, when .bash_profile exists, bash ignores .profile, so we have to source
# it explicitly.
if [ -f "$HOME/.profile" ]; then
. "$HOME/.profile"
fi