Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.
If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.
// Copied by https://gist.github.com/dotcypress/8fd12d6e886cd74bba8f1aa8dbd346aa, | |
// thanks for improving code style | |
const { createHash, createHmac } = require('crypto'); | |
const TOKEN = "ABC:12345..."; | |
// I prefer get the secret's hash once but check the gist linked | |
// on line 1 if you prefer passing the bot token as a param | |
const secret = createHash('sha256') | |
.update(TOKEN) |
setlocal ENABLEDELAYEDEXPANSION | |
set ssh_key_home=%HOME%\.ssh\ | |
set pageant_key_wildcard=*.ppk | |
echo Gathering keys matching %pageant_key_wildcard% in ^ | |
%ssh_key_home% | |
rem Check if pageant is running | |
for /f "tokens=2 delims=," %%F in ('tasklist /nh /fi "imagename eq PAGEANT.EXE" /fo csv') do ( |
This is a compiled list of falsehoods programmers tend to believe about working with time.
Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.
- There are always 24 hours in a day.
- February is always 28 days long.
- Any 24-hour period will always begin and end in the same day (or week, or month).
:: | |
:: This script installs wormhole (https://github.com/warner/magic-wormhole) and | |
:: its prerequisites. Run this as an administrator. | |
:: | |
:: Install chocolatey. | |
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" | |
:: Install Python 3. | |
choco install -y python |
Instructions to obtain ZSH on a windows environment, without the input funny business presented by some other attempted solutions.
The final result is ZSH running on a mintty terminal, emulated by cygwin, and being handled by the popular cmder.
For the benefit of myself and others. I've already followed these instructions twice. It took me hours to figure all this out, maybe someone else can save a few.
- Installing and setting up cmder
-- AppleScript to create a new file in Finder | |
-- | |
-- Use it in Automator, with the following configuration: | |
-- - Service receives: no input | |
-- - In: Finder.app | |
-- | |
-- References: | |
-- - http://apple.stackexchange.com/a/129702 | |
-- - http://stackoverflow.com/a/6125252/2530295 | |
-- - http://www.russellbeattie.com/blog/fun-with-the-os-x-finder-and-applescript |