Advanced Search
Search Results
122 total results found
A survey of unhandledRejection and rejectionHandled handlers
This article was originally published at https://gist.github.com/joepie91/06cca7058a34398f168b08223b642162. Bluebird (http://bluebirdjs.com/docs/api/error-management-configuration.html#global-rejection-events) process.on//unhandledRejection: (Node.js)...
Checking file existence asynchronously
This article was originally published at https://gist.github.com/joepie91/bbf495e044da043de2ba. Checking whether a file exists before doing something with it, can lead to race conditions in your application. Race conditions are extremely hard to debug and, de...
Setting up Hydra
This article was originally published at https://gist.github.com/joepie91/c26f01a787af87a96f967219234a8723 in 2017. The NixOS ecosystem constantly changes, and it may not be relevant anymore by the time you read this article. Just some notes from my attempt a...
Specification (draft)
This is a draft. It is neither complete nor, probably, correct. Core concept A Promistream is, at its core, simply a chain of Promises established through recursive asynchronous calls. A read is requested from the last stream in a pipeline (the "sink"), it r...
Error handling (with Promises)
This article was originally published at https://gist.github.com/joepie91/c8d8cc4e6c2b57889446. It only applies when using Promise chaining syntax; when you use async/await, you are instead expected to use try/catch, which unfortunately does not support error ...
Please don't include minified builds in your npm packages!
This article was originally published at https://gist.github.com/joepie91/04cc8329df231ea3e262dffe3d41f848. There's quite a few libraries on npm that not only include the regular build in their package, but also a minified build. While this may seem like a h...
Normies just don't care about privacy
If you're a privacy enthusiast, you probably clicked a link to this post thinking it's going to vindicate you; that it's going to prove how you've been right all along, and "normies just don't care about privacy", despite your best efforts to make them care. T...
How to get the actual width of an element in jQuery, even with border-box: box-sizing
This article was originally published at https://gist.github.com/joepie91/5ffffefbf24dcfdb4477. This is ridiculous, but per the jQuery documentation: Note that .width() will always return the content width, regardless of the value of the CSS box-sizing...
Stepping through builder steps in your custom packages
This article was originally published at https://gist.github.com/joepie91/b0041188c043259e6e1059d026eff301. Create a temporary building folder in your repository (or elsewhere) and enter it: mkdir test && cd test nix-shell ../main.nix -A packagename (assu...
Using dependencies in your build phases
This article was originally published at https://gist.github.com/joepie91/b0041188c043259e6e1059d026eff301. You can just use string interpolation to add a dependency path to your script. For example: { # ... preBuildPhase = '' ${grunt-cli}/bin/gru...
Source roots that need to be renamed before they can be used
This article was originally published at https://gist.github.com/joepie91/b0041188c043259e6e1059d026eff301. Some applications (such as Brackets) are very picky about the directory name(s) of your unpacked source(s). In this case, you might need to rename one...
Error: `error: cannot coerce a function to a string`
This article was originally published at https://gist.github.com/joepie91/b0041188c043259e6e1059d026eff301. Probably caused by a syntax ambiguity when invoking functions within a list. For example, the following will throw this error: { # ... srcs = [...
`buildInputs` vs. `nativeBuildInputs`?
This article was originally published at https://gist.github.com/joepie91/b0041188c043259e6e1059d026eff301. More can be found here. buildInputs: Dependencies for the (target) system that your built package will eventually run on. nativeBuildInputs: Depen...
QMake ignores my `PREFIX`/`INSTALL_PREFIX`/etc. variables!
This article was originally published at https://gist.github.com/joepie91/b0041188c043259e6e1059d026eff301. QMake does not have a standardized configuration variable for installation prefixes - PREFIX and INSTALL_PREFIX only work if the project files for the...
Futures and Tokio
This article was originally published at https://gist.github.com/joepie91/bc2d29fab43b63d16f59e1bd20fd7b6e. It may be out of date. Event loops If you're not familiar with the concept of an 'event loop' yet, watch this video first. While this video is about t...
Useful tools for working with NixOS
This article was originally published at https://gist.github.com/joepie91/67316a114a860d4ac6a9480a6e1d9c5c. Some links have been removed, as they no longer exist, or are no longer updated. Online things Package search Options search A list of channels, a...
Proprietary AMD drivers (fglrx) causing fatal error in i387.h
This article was originally published at https://gist.github.com/joepie91/ce9267788fdcb37f5941be5a04fcdd0f. It should no longer be applicable, but is preserved here in case a similar issue reoccurs in the future. If you get this error: /tmp/nix-build-ati-dri...
Installing a few packages from `master`
This article was originally published at https://gist.github.com/joepie91/ce9267788fdcb37f5941be5a04fcdd0f. You probably want to install from unstable instead of master, and you probably want to do it differently than described here (eg. importing from URL or...
GRUB2 on UEFI
This article was originally published at https://gist.github.com/joepie91/ce9267788fdcb37f5941be5a04fcdd0f. These instructions are most likely outdated. They are kept here for posterity. This works fine. You need your boot section configured like this: { ...
Unblock ports in the firewall on NixOS
This article was originally published at https://gist.github.com/joepie91/ce9267788fdcb37f5941be5a04fcdd0f. The firewall is enabled by default. This is how you open a port: { # ... networking = { # ... firewall = { allowedTCPPor...