ppi
asint
pageResolution
inpx
imageResolution
inpx
pageSize
ininches
/** | |
* contrast.less | |
* the built-in contrast() function in LESS sucks, this one works | |
* calculates the perceptual brightness of a color and assigns an int value to it | |
* to determine whether contrasting color should be dark or light | |
* | |
* usage: | |
* #contrast(@color: #f00; @threshold: 43; @dark: #222; @light: #eee; @more: '!important'); | |
* | |
* using specific params: |
const { resolve } = require('path'); | |
/** | |
* Resolve tsconfig.json paths to Webpack aliases | |
* @param {string} tsconfigPath - Path to tsconfig | |
* @param {string} webpackConfigBasePath - Path from tsconfig to Webpack config to create absolute aliases | |
* @return {object} - Webpack alias config | |
*/ | |
function resolveTsconfigPathsToAlias({ | |
tsconfigPath = './tsconfig.json', |
- Install wine-staging (
pacman -S wine-staging
) - Install the latest Nvidia drivers (
pacman -S nvidia-dkms nvidia-utils lib32-nvidia-utils
) - Create a GTA DXVK config file [1]
- Set GTA 5 launch option in Steam to
DXVK_CONFIG_FILE=/<PATH_TO_YOUR_CONFIG>/gta_dxvk.conf %command%
- Copy
steam/steamapps/common/Proton 3.7/user_settings.sample.py
tosteam/steamapps/common/Proton 3.7/user_settings.py
- Uncomment
"PROTON_NO_ESYNC": "1"
in user_settings.py
- Uncomment
- Copy all Windows fonts from a Windows ISO to
/usr/share/fonts/WindowsFonts
OR installttf-ms-win10
from the AUR - Run
fc-cache -vfr
to rebuild the font cache
(Hopefully) fix Docker DNS issues with systemd distros, e.g. ping: bad address 'google.com'
, Temporary failure resolving ...
, EAI_AGAIN
(tested on Arch).
- Host DNS is correct (
/etc/resolv.conf
) and does not contain any invalid nameservers - Ensure DNS resolves correctly (
dig google.com @ipaddress.from.resolvconf.here
) - Ensure Docker container has same config as host
docker run -it <your-image> cat /etc/resolv.conf
Expose the Content-Disposition
header using the Access-Control-Expose-Headers
header and set
the Content-Disposition
header as you would usually.
Access-Control-Expose-Headers: Content-Disposition
Content-Disposition: attachment; filename="example-file.csv"
The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.
In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.
This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.