Skip to content

Instantly share code, notes, and snippets.

@stisti
stisti / .bashrc
Created June 5, 2015 18:40
Jenkins jobname completion
jenkins_jobnames() {
node -e 'require("request")({url: process.env.JENKINS_URL+"/view/All/api/json", strictSSL: false},function(e,r,b){JSON.parse(b).jobs.forEach(function(e){console.log(e.name)})})'
}
# Alternative implementation
jenkins_jobnames2() {
http $JENKINS_URL/api/json | jq -r .jobs[].name
}
__jenkins_jobname_complete() {
@stisti
stisti / xprotect_watch.plist
Last active December 23, 2015 02:09
Launch agent that notifies when XProtect updates. Drop this into ~/Library/LaunchAgents and log out and back in or run: launchctl load ~/Library/LaunchAgents/xprotect_watch.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>fi.iki.sti.xprotect_watch</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/growlnotify</string>
<string>--title</string>
@stisti
stisti / Reload until text found.applescript
Last active December 20, 2015 09:19
Someone asked on Twitter how to refresh Safari window until a text is found. I thought that must be simple. Well, it still took me about an hour to put this together.
tell application "Safari"
activate
try
set urlForPolling to URL of front document
set tabForPolling to current tab of front window
on error
display dialog "Please open some web page first" with title "Error" with icon stop buttons {"OK"} default button 1
return
end try
display dialog "Reload the active page until a text is found." & return & "Enter the text to look for" with title "Safari reloader" default answer ""
@stisti
stisti / gist:1332023
Created November 1, 2011 21:47
lein error
$ lein help
+ LEIN_VERSION=1.6.1.1
+ export LEIN_VERSION
+ case $LEIN_VERSION in
+ SNAPSHOT=NO
+ '[' darwin10.0 = cygwin ']'
++ whoami
+ '[' tikksa = root ']'
+ NOT_FOUND=1
+ ORIGINAL_PWD=/Users/tikksa