Skip to main content
tygersync u/tygersync avatar

tygersync

u/tygersync

Feed options
Hot
New
Top
View
Card
Compact

Image
A banner for the subreddit

r/AppleWatch is the community to discuss and share information and opinions about Apple Watch, the smart watch from Apple.


Weekly visitors Weekly contributions
r/AppleWatch
A banner for the subreddit

r/AppleWatch is the community to discuss and share information and opinions about Apple Watch, the smart watch from Apple.


Weekly visitors Weekly contributions

There goes my streak. Had to choose rest & self-care. It’s so important.

tygersync
commented

Yeah. The runners that get injured the most:

  • Run 1 day a week

  • Run 7 days a week

Light to moderate regular exercise decreases cortisol levels. Excessive high-intensity exercise increases cortisol levels.

Would be cool if "the algorithm" detected the high intensity days and automatically dialed back the goal for the following day(s).

ie. "Hey Turbo, great job with that intense workout today! Your goal tomorrow will be some light exercise and recovery. You earned it!"


For fans of the Go Language based static site generator called Hugo. Everything fits in one executable and it is available on many operating systems including Windows, Linux, Mac OS X, FreeBSD, and NetBSD.


Weekly visitors Weekly contributions
r/gohugo

For fans of the Go Language based static site generator called Hugo. Everything fits in one executable and it is available on many operating systems including Windows, Linux, Mac OS X, FreeBSD, and NetBSD.


Weekly visitors Weekly contributions

Article: Beyond the Hype — Is Hugo the Right Fit for Your Site?

tygersync
commented

Thanks for the great tip; I'll check it out.


Article: Beyond the Hype — Is Hugo the Right Fit for Your Site?
r/gohugo

For fans of the Go Language based static site generator called Hugo. Everything fits in one executable and it is available on many operating systems including Windows, Linux, Mac OS X, FreeBSD, and NetBSD.


Weekly visitors Weekly contributions
Article: Beyond the Hype — Is Hugo the Right Fit for Your Site?

Friends ask me if they should be moving to Hugo, since they keep hearing about how awesome it is. I finally wrote an article that (hopefully) concisely explains whether or not someone should consider adopting Hugo.

Beyond the Hype — Is Hugo the Right Fit for Your Site?

Let me know if I missed anything, or explained something incorrectly. Thanks!





Image
A banner for the subreddit

PowerShell is a cross-platform (Windows, Linux, and macOS) automation tool and configuration framework optimized for dealing with structured data (e.g. JSON, CSV, XML, etc.), REST APIs, and object models. PowerShell includes a command-line shell, object-oriented scripting language, and a set of tools for executing scripts/cmdlets and managing modules.


Weekly visitors Weekly contributions
r/PowerShell
A banner for the subreddit

PowerShell is a cross-platform (Windows, Linux, and macOS) automation tool and configuration framework optimized for dealing with structured data (e.g. JSON, CSV, XML, etc.), REST APIs, and object models. PowerShell includes a command-line shell, object-oriented scripting language, and a set of tools for executing scripts/cmdlets and managing modules.


Weekly visitors Weekly contributions

Dynamic cross-project tab completion

tygersync
commented

As currently implemented, there's a security risk with this script:

Let's say you want to add dynamic tab completion involving a compiled binary. In that case, the script allows you to define a helpCommand in .argument-completer-registry.json. When you press Tab, the help command is executed and its output cached in %temp%.

Normally that's fine, as the executed binary is under your control. However, if an attacker manages to trick you into downloading, say, a malicious Git repo containing an evil .argument-completer-registry.json pointing to an even more evil executable, it would be executed automatically by the argument completer.

Maybe I should modify the script to never execute anything and instead require everything be parseable.


Dynamic cross-project tab completion
Image
r/PowerShell
A banner for the subreddit

PowerShell is a cross-platform (Windows, Linux, and macOS) automation tool and configuration framework optimized for dealing with structured data (e.g. JSON, CSV, XML, etc.), REST APIs, and object models. PowerShell includes a command-line shell, object-oriented scripting language, and a set of tools for executing scripts/cmdlets and managing modules.


Weekly visitors Weekly contributions
Dynamic cross-project tab completion

Hola,

Many software projects have custom, project-specific scripts like build, make, test, etc. Those commands often have dozens of possible arguments, and they tend to differ from one project to the next, especially if you work with multiple teams. I want me some tab completion! :)

I wrote a proof-of-concept script that leverages PowerShells' Register-ArgumentCompleter to add tab completion to these commands.

How do you use it?

  1. Put Register-DynamicArgumentCompleters.ps1 somewhere on your computer.

  2. In your PowerShell profile, run something like C:\RandomTools\Register-DynamicArgumentCompleters.ps1 -commandsToComplete @("build", "cake", "test")

  3. Most importantly, add a file called .argument-completer-registry.json to each project. This file describes the "completable commands" for that project and how to parse them. See the gist for examples.

  4. The next time you're in that project and type .\build, the argument completer will look up .argument-completer-registry.json to see how to parse the current project's build script, parse it, and then allow you to tab complete the possible build commands. Yay...

The script also creates a simple PowerShell wrapper function for each of the "commandsToComplete". That way you can type .\build, ./build, or build, for example.

Currently it supports parsing Cake and Psake scripts, since they're common on PowerShell. It also supports Make scripts since they're easy to parse. It should be possible to add support for NPM scripts as well, really anything parsable with a regex.

I might turn it into a nuget/chocolatey package for ease of installation and configuration. Not really sure. I wanted to get some feedback first.