Skip to content

Instantly share code, notes, and snippets.

@zionyx
zionyx / test.groovy
Created November 20, 2019 08:28
Test syntax highlighting
import groovy.transform.Field
@Field Set SUPPORTED_TOOLS = [
'gitversion'
]
@zionyx
zionyx / README.md
Last active January 27, 2023 20:16
JavaScript to delete all inactive workflows in JIRA
@zionyx
zionyx / profile.ps1
Created October 22, 2018 09:10
PowerShell profile without Docker commands
# Chocolatey profile
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path($ChocolateyProfile)) {
Import-Module "$ChocolateyProfile"
}
#try { $null = gcm pshazz -ea stop; pshazz init } catch { }
$env:PYTHONIOENCODING="utf-8"
# TLS 1.2 support
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 -bor
# Get the UnitTest Binaries
$files = Get-ChildItem $TestAssembliesDir\*est*.dll
# VSTest.console.exe path
$VSTestPath = 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe'
# MSTest path
$MSTestpath = "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\mstest.exe"
# Loop through the test assemblies and add them to the VSTestFiles
@zionyx
zionyx / keybindings.json
Created March 28, 2017 09:58
Personal vscode keybindings. Also fixes an annoyance: Escape to close Find widget window when it is focused.
// Place your key bindings in this file to overwrite the defaults
[
{ "key": "ctrl+shift+o", "command": "workbench.action.files.openFolder" },
{ "key": "ctrl+k ctrl+d", "command": "editor.action.formatDocument" },
{ "key": "escape", "command": "closeFindWidget",
"when": "findWidgetFocus && findWidgetVisible" }
]
@zionyx
zionyx / gist:b604170fe14a40af2c41e27e750f1ee5
Last active August 18, 2021 07:23 — forked from jaturken/gist:3976117
Scala features cheatsheet

Scala Cheat Sheet

This cheat sheet originated from the forum, credits to Laurent Poulain. We copied it and changed or added a few things.

Evaluation Rules

  • Call by value: evaluates the function arguments before calling the function
  • Call by name: evaluates the function first, and then evaluates the arguments if need be
@zionyx
zionyx / gist:403027aa4752bb382a44308fbe8c4470
Created November 30, 2016 13:53 — forked from trodrigues/gist:1023167
Checkout only certain branches with git-svn
If you want to clone an svn repository with git-svn but don't want it to push all the existing branches, here's what you should do.
* Clone with git-svn using the -T parameter to define your trunk path inside the svnrepo, at the same time instructing it to clone only the trunk:
git svn clone -T trunk http://example.com/PROJECT
* If instead of cloning trunk you just want to clone a certain branch, do the same thing but change the path given to -T:
git svn clone -T branches/somefeature http://example.com/PROJECT
@zionyx
zionyx / Create-Jenkins-Slave-On-Windows-Server-Core.ps1
Last active October 7, 2016 22:02 — forked from PlagueHO/ Create-Jenkins-Slave-On-Windows-Server-Core.ps1
Create a Jenkins Slave on a Windows Server 2012 R2 Core install
# Configure the settings to use to setup this Jenkins Slave
$IPAddress = '192.168.1.96'
$SubnetPrefixLength = 24
$DNSServers = @('192.168.1.1')
$DefaultGateway = '192.168.1.1'
$JenkinsSlaveFolder = 'c:\jenkins'
# Install .NET Framework 3.5
Install-WindowsFeature -Name NET-Framework-Core
@zionyx
zionyx / DelCert.cpp
Created October 3, 2016 20:11
Someone wrote a cool tool that removes certificates from signed files.
#define _WIN32_WINNT 0x0400
#include <stdio.h>
#include <windows.h>
#include <Wincrypt.h>
#define MY_ENCODING_TYPE (PKCS_7_ASN_ENCODING | X509_ASN_ENCODING)
void MyHandleError(char *s);
void main(void)
{
//-------------------------------------------------------------------
@zionyx
zionyx / cleanupUnusedWorkspaceInSlaves.groovy
Created September 16, 2016 13:17 — forked from ceilfors/cleanupUnusedWorkspaceInSlaves.groovy
When you delete jobs in Jenkins, the corresponding workspaces in the build slaves won't be deleted automatically. This Jenkins script will go to each slave and check if the jobs are already deleted in Jenkins master and delete the workspace.
import com.cloudbees.hudson.plugins.folder.Folder
import hudson.FilePath
import jenkins.model.Jenkins
def boolean isFolder(String name) {
def item = Jenkins.instance.getItemByFullName(name)
return item instanceof Folder
}
def deleteUnusedWorkspace(FilePath root, String path) {