Skip to content

Instantly share code, notes, and snippets.

View daper's full-sized avatar

David Peralta daper

View GitHub Profile
@daper
daper / githubApiBuilderWrapper.groovy
Created August 25, 2020 18:02
withGitHubAPI: Simple GitHub Api Builder Wrapper for Jenkins with GitHub App JWT Authentication
#!/usr/bin/env groovy
import java.util.Base64
import java.security.Key
import java.security.PrivateKey
import java.security.KeyFactory
import java.security.spec.KeySpec
import java.security.spec.PKCS8EncodedKeySpec
import org.kohsuke.github.GHApp
@daper
daper / backup.sh
Created November 18, 2018 19:15
Shell Only S3 Upload Script with Multipart support. Requirements: openssl, curl. Optional: gnu-parallel.
#!/bin/sh
# Author: daper <david@daper.email>
# Description: Shell Only S3 Upload Script with Multipart support.
# Requirements: openssl curl
# Optional: gnu-parallel
# Full path to this script.
# This is needed when using gnu-parallel.
# Please set-up manually.
SCRIPT="$(pwd)/backup.sh"
@daper
daper / fibonacci.sh
Created March 21, 2017 22:26
Bash implementation of Fast Doubling Fibonacci Series calculation. See: https://www.nayuki.io/page/fast-fibonacci-algorithms
#!/bin/bash
export BC_LINE_LENGTH=0
function fib() {
if [ $1 -lt 0 ]; then
echo "ERROR: Negative numbers not implemented"
exit 1
fi
@daper
daper / ah_fake_sendEmail_task.js
Last active February 9, 2017 11:31
POC: Generic timeout to inline-processed tasks with actionhero.js initializer.
'use strict'
exports.task = {
name: 'sendEmail',
description: 'My Task',
frequency: 0,
queue: 'mail',
middleware: [],
run: function (api, params, next) {
@daper
daper / .bash_prompt
Last active October 18, 2016 09:45
GIT and ColorFull Bash Prompt. Based: https://gist.github.com/31967
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch/status of the current git repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.