← Înapoi la Urmăritori

Cel mai recent articol

Ultima verificare

Urmăritori 0 urmăritori
Articole: 74
  1. For some reason, Google Calendar doesn’t make your shared calendar subscriptions available on other devices out of the box.

  2. Piper is a fast TTS engine that’s performant enough to run on the cheapest Hetzner VPS.

  3. By default, macOS shows a list of local users when you lock the screen, even if the boot login screen is set to name and password only (System Preferences → Lock Screen → Login window shows: Name and password).

  4. macOS: Remap a key

    You can use hidutil to remap keys in macOS without using a third party application.

  5. Even though the string type manipulation utilities you get out of the box with Typescript are rather limited, using Typescript’s most confusing feature, the infer keyword, you can push conversions between string types quite a lot further.

  6. A straightforward way to call C/C++ code from Node is to use node-gyp to build a Node addon.

  7. If you’re ever struggling to figure out why cloning a repository fails beyond the usual suspects, the following setup may be handy for you.

  8. Edited {{ “2023-04-19” | date_to_long_string: “ordinal” }}: There is currently no known way to defend against this attack.

  9. If you often jump between branches and sometimes lose track of which you have and haven’t pushed to the remote yet, it might be handy to get all local branches with no remote: git branch --format "%(refname:short) %(upstream)" | awk '{if (!

  10. Recommended reading: “Humans Need Play” by Allen Pike

  11. Cipollino salad

    This is a salad my mom used to make when I was young and to date I still love it to bits.

  12. When using custom components with Formik, a common problem to run into is some native form events breaking.

  13. Out of the box, single-page applications built with react-router don’t persist data when navigating back and forward in the browser history.

  14. By default, macOS does a small chiming sound whenever you plug the charger in.

  15. Get a patch from the diff between master and foo: git diff --no-color --binary master foo > /tmp/patch --no-color ensures the diff is valid to apply if you have automatic coloring on, --binary ensures binary files are handled correctly as well.

  16. What is Babel?

    Note: This is a response to this blog post by Julia Evans.

  17. Git supports showing colored diffs inline by the --color-words flag: $ git diff --color-words This is often easier to follow than the standard plus-minus format.

  18. Tunnelblick is the de facto OpenVPN client for macOS.

  19. Consider two or more shell scripts that may be run either by themselves or in parallel, but all rely on a specific setup step that isn’t parallelizable.

  20. If you use @babel/preset-env or simply browserslist by itself without configuration it falls back to the default configuration: > 0.5%, last 2 versions, Firefox ESR, not dead To see what this evaluates to you can run npx browserslist defaults, as of writ…

  21. Unlike some golfing languages, Japt doesn’t have too many tools to play around with prime numbers.

  22. Out of the box, Typescript doesn’t play well with Array.filter(Boolean).

  23. Running into this problem, you may notice one of two possible symptoms when running lint: either numerous flow processes are spawned and killed constantly, or the lint fails with the below error.

  24. Testing Library is the current recommended way to unit test React code.

  25. Typescript doesn’t have a simple type to describe the relation “allow any type except the string literals "foo" and "bar"”.

  26. Finding the number of overlapping needles in a haystack in Japt is slightly verbose, clocking in at 12 bytes, but still a fun fiddling exercise for a change. ðV // Get all indices of needle in the input. äÏ-X<Vl ä // For every consecutive pair…

  27. Annotating legacy jQuery with Typescript can be a pain.

  28. Passing type variables to Typescript generics is somewhat clunky in JSX, but still handy in certain cases.

  29. Typescript 4.1 adds support for template literal types.

  30. Getting case sensitive string compare in Javascript isn’t as trivial as it may seem at first: // Returns ["Action", "activity", "alpha"], // although ["activity", "alpha", "Action"] is expected instead ["alpha", "Action", "activity"].sort((a, b) => {…

  31. Trying to clone props children when using React with Typescript, you may run into the following type error: Type 'string' is not assignable to type ReactElement....

  32. In Bash, $* gives you the IFS expansion of all positional parameters, such as $1 $2 $3 etc.

  33. Javascript doesn’t have a builtin that’s comparable to Java’s Boolean.compare().

  34. Edited 2021-03-04: Upgraded actions/setup-node to version 2.

  35. osc cheatsheet for OBS

    Open Build Service, OBS for short, uses osc as its CLI interface. osc is an SVN-like version control system with a good overview and a starter configuration guide on the openSUSE wiki.

  36. If you’re answering a question on Stack Overflow and want to use a library in the code snippet that only supports AMD, the following small jig may be useful.

  37. VirtualBox network modes

    As covered in the VirtualBox networking docs, the quickest overview into different networking modes is the following table: VM ↔ VM VM → Host Host → VM VM → Net/LAN Net/LAN → VM Not attached - - - - - Internal Network + - - - - Host-only + + + - - NAT - +…

  38. At first glance, cy.readFile() and cy.fixture() seem fairly similar, both read files asynchronously and wrap them as Cypress usually does.

  39. It isn’t widely advertised, but macOS ships with a standalone sandboxing utility out of the box: sandbox-exec.

  40. Microsoft Intune is a remote device management and supervision solution employed by some corporations.

  41. If you need both stdout and stderr in a file for logging or debugging purposes, while also wanting to monitor the output of a command, you can use a pipe control operator along with tee: $ foo |& tee out.log

  42. MacOS ships with cpio out of the box, however it’s worth noting it’s bsdcpio, not the GNU cpio.

  43. Out of the box, trying to install M2Crypto on macOS will fail with one of two common scenarios on building.

  44. Simply prepending sudo to echo will fail since the redirection is executed by the shell, not the command you run. $ sudo echo "foo" >> /etc/bar bash: /etc/bar: Permission denied Shortly, the above is running echo as root, but >> will be run by the surrou…

  45. Start a virtual machine in headless mode: $ VBoxManage startvm <VM name or GUID> --type headless Save the machine state and then stop it: VBoxManage controlvm <VM name or GUID> savestate See the VBoxManage manual for more examples.

  46. Whether you’re setting up a fresh Linux VM in VirtualBox on macOS Catalina (10.15.6), or migrating a VM over from an older macOS version, you can be in for a nasty surprise — once the VM boots, VirtualBox crashes with a mere stack trace.

  47. The same approach applies to any branch, but reverting a file to its state in master seems to come up most often.

  48. MacOS uses launchd as the daemon for running services and other daemons.

  49. Git: Autosign commits

    After generating a GPG key and adding it to your Github account, automatically signing your commits is very straightforward.

  50. Since macOS doesn’t support OpenVPN out of the box, the easiest solution is to use Tunnelblick as your client.