In order to convert large and heavy images to light version for websites we can use ImageMagick and Parallel packages.
./convert.sh images/ output/
# OUTPUT
# /output/
header { | |
background-color: rgb(0, 153, 76); | |
padding: 10px 10px 15px 10px; | |
margin-left: 0px; | |
margin-right: 0px; | |
margin-top: 0px; | |
} | |
h1 { | |
font-weight: normal; |
To keep jenkins running in the background you can use screen
.
#!/bin/bash
# jenkins.sh
if ! pgrep "jenkins" > /dev/null; then
screen -dm java -Xms256m -Xmx512m -Dhudson.udp=-1 -Dhudson.DNSMultiCast$
fi
// simple JS script to parse and sum of donations for the chosen city | |
// usage | |
// 1. copy&paste below script | |
// 2. choose the city manually | |
// 3. then call e.g. `sum().then(alert)` or sum().then(sum => { console.log(sum); }) | |
sumDonations = () => { | |
return [...document.querySelectorAll('.institution .value').values()].map(e => parseFloat(e.innerText)).reduce((a,b) => a + b, 0) | |
} |
This recipe allows you to use the ssh-agent from homebrew with the auto generated SSH_AUTH_SOCK in /private/tmp. It works because disabling com.openssh.ssh-agent doesn't stop launchd from allocating SSH_AUTH_SOCK. com.homebrew.ssh-agent spawns a shell to remove the socket and then execute the homebrew ssh-agent.
launchctl disable gui/$UID/com.openssh.ssh-agent
launchctl bootstrap gui/$UID com.homebrew.ssh-agent.plist