Skip to content

Instantly share code, notes, and snippets.

@vladfau
vladfau / fast-my-keyboard.sh
Created May 14, 2020
Mac keyboard input made faaaast
View fast-my-keyboard.sh
#!/bin/zsh
defaults write -g ApplePressAndHoldEnabled -bool false
defaults write -g KeyRepeat -int 1
defaults write -g InitialKeyRepeat -int 10
@vladfau
vladfau / perms-ldap.groovy
Created Jun 18, 2019
Jenkins Active Permissions via LDAP
View perms-ldap.groovy
def userid = User.current().id
def auths = Jenkins.instance.securityRealm.loadUserByUsername(userid)
.authorities.collect{a -> a.authority}
@NonCPS
def collectLDAPS(uid) {
println uid
return Jenkins.instance.securityRealm.loadUserByUsername(uid).authorities.collect{a -> a.authority}
}
@vladfau
vladfau / MavenBOC.groovy
Created Feb 16, 2019
Maven Build only Changed
View MavenBOC.groovy
import hudson.FilePath
import hudson.model.Hudson
import java.nio.file.Paths
import java.rmi.UnexpectedException
return this;
/**
* Dope thing to enhance analysis of inter-module dependencies in Maven and getting info about what was changed
@vladfau
vladfau / post.groovy
Last active Jul 15, 2021
Sending POST + JSON Body + Auth - Libs in Java/Groovy (e.g. create tag on GitHub)
View post.groovy
import groovy.json.JsonOutput
import java.io.BufferedWriter
import java.io.OutputStreamWriter
import java.net.URL
import java.util.Scanner
def url = new URL("https://${github}/api/v3/repos/${org}/${repo}/git/refs")
def urlConnection = url.openConnection()
urlConnection.setDoOutput(true)
View .tmux.conf
set -g default-terminal "screen-256color"
set-option -g default-command "reattach-to-user-namespace -l zsh" # or bash...
bind C-c run "tmux save-buffer - | reattach-to-user-namespace pbcopy"
set-option -g mouse on
set -g status-interval 3
set-option -g status-bg colour153
set -g status-right-length 150
set -g status-right "#[fg=colour236]| #[fg=colour25] %d %b :: #(date +%%H:%%M) "