sysctl -w fs.file-max=12000500
sysctl -w fs.nr_open=20000500
# Set the maximum number of open file descriptors
ulimit -n 20000000
# Set the memory size for TCP with minimum, default and maximum thresholds
sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const speedRate = 2; | |
const subtitles = document.querySelector('.player-timedtext'); | |
let observer = new MutationObserver(() => { | |
document.querySelector('video').playbackRate = subtitles.textContent | |
? 1 | |
: speedRate; | |
}).observe(subtitles, { childList: true }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Gambling Statistics Problem: | |
# If you play roulette every day and quit whenever you're ahead by x amount, | |
# do you make money in the long run? | |
# Answer: | |
# No. | |
import random | |
STARTING_BALANCE = 100000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Include this at the very top of both your main and window processes, so that | |
// it loads as soon as possible. | |
// | |
// Why does this work? The node.js module system calls fs.realpathSync a _lot_ | |
// to load stuff, which in turn, has to call fs.lstatSync a _lot_. While you | |
// generally can't cache stat() results because they change behind your back | |
// (i.e. another program opens a file, then you stat it, the stats change), | |
// caching it for a very short period of time is :ok: :gem:. These effects are | |
// especially apparent on Windows, where stat() is far more expensive - stat() | |
// calls often take more time in the perf graph than actually evaluating the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<select name=""> | |
<option value="USD" selected="selected">United States Dollars</option> | |
<option value="EUR">Euro</option> | |
<option value="GBP">United Kingdom Pounds</option> | |
<option value="DZD">Algeria Dinars</option> | |
<option value="ARP">Argentina Pesos</option> | |
<option value="AUD">Australia Dollars</option> | |
<option value="ATS">Austria Schillings</option> | |
<option value="BSD">Bahamas Dollars</option> | |
<option value="BBD">Barbados Dollars</option> |