1,029 karma · joined January 3, 2010
The use case described is for a small one off script for use in CI, or a single file script you send off to a colleague over Slack. Very, very common scenario for many of us. If your script depends on
a => c
b => c
You can pin versions of those direct dependencies like "a" and "b" easy enough, but 2 years later you may not get the same version of "c", unless the authors of "a" and "b" handle their dependency constraints perfectly. In practice that's really hard and never happens.The timestamp appraoch described above isn't perfect, but would result in the same dep graph, and results, 99% of the time..
In my "real world" usage, I've found "bash strict mode" incredibly useful, especially when scripting things that others will be modifying. It just avoids all of the "somebody forgot an error check", "there's a typo in a variable name", etc., type errors. And pouring through logs to figure out what actually went wrong in CI/CD is brutal.
Looking at the examples:
- I don't generally do arithmetic in bash, that's a sign of "time to change language" - Also generally use `if ...; then ...; fi` instead of `test ... && ...`
If you do the advanced type of scripting that somebody who writes a Bash FAQ does, I'm sure `set -e` can be annoying. But once you learn a couple simple idioms y(covered on the original "bash strict mode" page) you don't have to know much more to have fairly robust scripts. And future maintainers will thank you for it!
The hourly workers (i.e., unionized) still got 100%, which was pretty unfair.
I'm actually kinda excited to find PyGaze, we might play with it and see if I can tweak a few things to improve his experience.
We will support candidates for office who align with our core principles so that we can reform the system and make it more responsive to the American people. This means that we will support Republicans, Democrats, and Independents - as well as candidates identifying themselves as Forward Party members.
1. https://www.forwardparty.com/whyforward1. https://pytorch.org/tutorials/intermediate/mario_rl_tutorial...
/usr/bin/security find-internet-password -wgs mydomain.com
It requires the keychain to be unlocked, which can be handled with touch ID, and you can have it confirm with a "are you sure" dialog box every time.If you really wanted to be prompted for a fingerprint basically every time, you could probably use a separate keychain that locks after 1 minute of inactivity.
You can also actually combine those syntaxes - I often use f"{foo:%Y-%m-%d!r}" to get a quoted, properly escaped date in a specific format, for example.
The dependency I referenced actually uses poetry, and the reason it's borked is because "poetry add pandas" back when 0.25.1 was current meant effectively adding "poetry==^0.25.1" to requirements.txt, even though the one line of actual code that uses pandas works on pretty much any version I've ever seen.
For example, I have a dependency that specifies pandas at ^0.25.1, and now I can't install it alongside pandas 1.0+ without forking or getting a PR upstreamed (even though I know it works with all versions of pandas just fine.)
In the node ecosystem, yarn actually recognizes that this situation exists and provides a mechanism to override, along with some good descriptions of situations where it's necessary[1].
[1] https://classic.yarnpkg.com/en/docs/selective-version-resolu...
1. https://mullvad.net/en/servers/
On a USG the config looks like this:
wireguard wg0 {
address ***/32
mtu 1420
peer *** {
allowed-ips 0.0.0.0/0
endpoint ***:51820
}
private-key ***
route-allowed-ips false
up-command "ip route add 10.64.0.1/32 dev wg0 && ip route add 10.124.0.0/16 dev wg0"
}Great for all kinds of silly GeoIP restrictions, too - in my part of the world, homedepot.com just spits out "access denied", a foodnetwork.com recipe you find in search results just redirects you to the tudiscovery.com homepage, etc.
I've long been looking for something that lets me keep my static yaml for my own projects, and helm charts with occasional small tweaks, and Tanka seems to do it!
local parseYaml = std.native('parseYaml');
local k = (import 'ksonnet-util/kausal.libsonnet');
local helm = (import 'helm-util/helm.libsonnet').new(std.thisFile);
{
aws_secret: parseYaml(importstr 'k8s/aws-secret.yaml'),
// etc...
traefik: helm.template('traefik', '../../charts/traefik', {
values: parseYaml(importstr 'values/traefik.yaml')[0],
}) + {
// traefik requires a /plugins-storage tmpdir
deployment_traefik+: k.util.emptyVolumeMount('plugins-storage', '/plugins-storage'),
},
}
If I had one request, it'd be to be able to run an arbitrary command for manifest generation: jsonnet seems quite capable, but every once in a while you're in a rush and just can't figure out how to do something - that's when being able to generate the manifest dynamically via bash/python/whatever is quite useful. def square(number: numbers.Complex) -> numbers.Real: ...
T = typing.TypeVar('T', numbers.Real)
def square(number: T) -> T:
return number ** 2
What a rabbit hole!I think typing_extensions.Protocol helps support the general duck typing "any object that has method x", though there are some implementation issues w/ dataclasses and such..
def square(number: int | float) -> int | float:
return number ** 2
A TypeVar constrained to int and float, T = TypeVar('T', int, float), should be used instead to indicate that the return type is the same as the argument type, no?