|
You are here |
2ality.com | ||
| | | | |
blog.logrocket.com
|
|
| | | | | Explore what TypeScript types are, with a deep dive into the `never` and `unknown` types and a comparison between them and the `any` type. | |
| | | | |
microsoft.github.io
|
|
| | | | | [AI summary] This article provides a comprehensive overview of TypeScript's type system, including function types, generics, and constraints. It discusses how to describe functions, use generics to relate input and output types, and apply constraints to limit type parameters. The text also covers function type expressions, call signatures, and the importance of proper type annotations in ensuring type safety and avoiding runtime errors. Key concepts include function types, generics, constraints, and their applications in real-world scenarios such as handling arrays and objects with specific properties. | |
| | | | |
hop.ie
|
|
| | | | | A summary of how TypeScript works in various examples. | |
| | | | |
willhaley.com
|
|
| | | See here an example of a custom Linux mount script, written in Python, that can be used to mount disks with /etc/fstab. The mount script is installed at /usr/bin/mount.my-command and is executable. #!/usr/bin/env python3 import sys import subprocess device = sys.argv[1] mount_point = sys.argv[2] options = sys.argv[4] # Any customization could be done here to the `mount` command that is run. mount_command = ['mount', '-o', options, device, mount_point] output = subprocess.run( mount_command, capture_output=True ) if output.returncode != 0: print("error mounting") print(output.stderr.decode('UTF-8')) sys.exit(output.returncode) See here how the custom script can then be used in /etc/fstab like any "normal" mount. | ||