Table of Contents
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Requires https://plugins.jenkins.io/mask-passwords to run | |
/** | |
* Runs code with secret environment variables and hides the values. | |
* | |
* @param varAndPasswordList - A list of Maps with a 'var' and 'password' key. Example: `[[var: 'TOKEN', password: 'sekret']]` | |
* @param Closure - The code to run in | |
* @return {void} | |
*/ | |
def withSecretEnv(List<Map> varAndPasswordList, Closure closure) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// define the bitbucket project + repos we want to build | |
def bitbucket_project = 'myproj' | |
def bitbucket_repos = ['myrepo1', 'myrepo2'] | |
// create a pipeline job for each of the repos and for each feature branch. | |
for (bitbucket_repo in bitbucket_repos) | |
{ | |
multibranchPipelineJob("${bitbucket_repo}-ci") { | |
// configure the branch / PR sources | |
branchSources { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# use ImageMagick convert | |
# the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf | |
convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def manager = org.jenkins.plugins.lockableresources.LockableResourcesManager.get() | |
def resources = manager.getResources().findAll{ | |
!it.locked | |
} | |
resources.each{ | |
manager.getResources().remove(it) | |
} | |
manager.save() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- MIT License --> | |
<html> | |
<head> | |
<script> | |
function generateKey(alg, scope) { | |
return new Promise(function(resolve) { | |
var genkey = crypto.subtle.generateKey(alg, true, scope) | |
genkey.then(function (pair) { | |
resolve(pair) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var crypto = require('crypto') | |
, fs = require('fs') | |
// Algorithm depends on availability of OpenSSL on platform | |
// Another algorithms: 'sha1', 'md5', 'sha256', 'sha512' ... | |
var algorithm = 'sha1' | |
, shasum = crypto.createHash(algorithm) | |
// Updating shasum with file content | |
var filename = __dirname + "/anything.txt" |
I tried a few different techniques to make a GIF via command-line and the following gives me the best control of quality and size. Once you're all setup, you'll be pumping out GIFs in no time!
Install FFmpeg
- $ brew install ffmpeg [all your options]
- Example: $ brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools
Install ImageMagick
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function () { | |
"use strict"; | |
// for better performance - to avoid searching in DOM | |
var content = $('#content'); | |
var input = $('#input'); | |
var status = $('#status'); | |
// my color assigned by the server | |
var myColor = false; |
NewerOlder