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
$syncScript = $PSScriptRoot + "\sync-minecraft-saves.ps1" | |
$minuteRepeat = 10 | |
schtasks /create /sc minute /mo $minuteRepeat /ru System /tn "Minecraft Save Sync" /tr "powershell.exe -NoLogo -WindowStyle hidden -file $syncScript" |
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 nightRoute(city) | |
final = city.length - 1 | |
hops = {} | |
hops[0] = city[0].each_with_index.map{ |length, island| length == -1 ? nil : [0, island] }.compact | |
(1..final).each do |iter| | |
hops[iter] = hops[iter - 1].map do |path| | |
if path[-1] == final | |
nil | |
else | |
city[path[-1]].each_with_index.map do |length, island| |
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 perfectCity(departure, destination) | |
diff(departure[0], destination[0]) + diff(departure[1], destination[1]) | |
end | |
def diff(dep, dest) | |
naiveDiff = (dep - dest).abs | |
extraDiff = 0 | |
if dep.ceil == dest.ceil | |
lower, higher = [dep, dest].sort | |
extraDiff = [lower - lower.floor, higher.ceil - higher].min * 2 |
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
// This defines a cron trigger for a scripted Jenkinsfile: | |
properties([pipelineTriggers([cron('*/10 8-22 * * 1-5')])]) | |
node { | |
stage('Checkout Repo with Script') { | |
checkout scm | |
} | |
dir('conflict-checker') { | |
stage('Check branches for merge conflicts') { | |
// These were defined in the Jenkinsfile for my particular needs, but don't have to be. |
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
# swagger2markup output fed to asciidoctor-pdf - all via published docker images | |
# The following is a Makefile command in the root of a web service repo with the following assumptions: | |
# ./swagger/v1/swagger.json is the swagger definition (created by rswag in my case) | |
# ./_docs/ is where we want the PDF and intermediate ADOC to live | |
# The ADOC file is pretty useful, but if you just want the PDF, it's a byproduct you might want to clean up | |
api_pdf: | |
docker run --rm -v $(shell pwd):/opt swagger2markup/swagger2markup convert -i /opt/swagger/v1/swagger.json -f /opt/_docs/api-definition | |
docker run --rm -v $(shell pwd)/_docs:/documents/ asciidoctor/docker-asciidoctor asciidoctor-pdf api-definition.adoc |
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
# Run the following from a directory containing multiple git repositories | |
# The `28` in the printf command is arbitrary and just matches the number of characters in the longest-named repo I have. | |
function repo_states () { | |
for repo in */; do | |
printf '%-28s' "$repo" | |
( cd "$repo" && git status --short --branch --untracked-files=no ) | |
done | |
} |
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
#z:: | |
KeyWait, LWin | |
KeyWait, RWin | |
Clip0 = %ClipBoardAll% ; Save formatted text for later | |
ExcelBound = %Clipboard% | |
Loop, parse, ExcelBound, `r`n | |
{ | |
if A_LoopField = | |
continue | |
nonemptyline := A_LoopField |
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
<NotepadPlus> | |
<UserLang name="J" ext="ijs" udlVersion="2.1"> | |
<Settings> | |
<Global caseIgnored="yes" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" /> | |
<Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" /> | |
</Settings> | |
<KeywordLists> | |
<Keywords name="Comments">00NB. 01 02 03 04</Keywords> | |
<Keywords name="Numbers, prefix1"></Keywords> | |
<Keywords name="Numbers, prefix2"></Keywords> |
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
; Copied from http://www.autohotkey.com/board/topic/39551-change-the-default-mailto-to-gmail/ | |
; #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | |
; SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
; SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | |
Haystack = %1% | |
;~ If no paramter is given when the run of it, it registers itself as the default mailto | |
; commented out because I'd rather set it as default by myself. |
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
InputBox, password, Enter Password for Archives, The generated archives will be protected with the password you enter below. Your input will be masked., hide | |
; Using FileSelectFolder is just one way of choosing your folders. | |
FileSelectFolder, sourcepath,,, Source Folder | |
sourcepath := RegExReplace(sourcepath, "\\$") ; Removes the trailing backslash, if present. | |
FileSelectFolder, destinationpath,,, Destination Folder | |
destinationpath := RegExReplace(destinationpath, "\\$") ; Removes the trailing backslash, if present. | |
sourcelen := StrLen(sourcepath) + 1 ; Determine the start of the variable part of the path. | |
Loop, Files, %sourcepath%\*.*, R | |
{ |