A dead simple React Twemoji component.
npm install --save twemoji
A dead simple React Twemoji component.
npm install --save twemoji
| """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
| " Font | |
| :set guifont=Source\ Code\ Pro:h14 | |
| """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
| " Hide pointless junk at the bottom, doesn't work in .vimrc for some reason? | |
| :set laststatus=0 | |
| :set noshowmode "don't show --INSERT-- | |
| :set noruler "don't show line numbers/column/% junk |
next.js, nginx, reverse-proxy, ssl
Your server.js file should look like the following. Make sure you're serving static files!
const { createServer } = require('http');
const { parse } = require('url');
const next = require('next');| // we have an async "initialize" method that performs several calls consecutively. | |
| // after each step in the async chain, we might have been unmounted already | |
| // and performing any further calls becomes obsolete | |
| class DefaultComponent extends React.Component { | |
| // ... | |
| componentDidMount() { | |
| this._isMounted = true; | |
| this.initialize(); | |
| } | |
| componentWillUnmount() { |
| # IPv6 Configuration | |
| # -> note that I have disabled ip6 for our internet-connection (wan/eth0) because | |
| # -> my upstream/ISP (still) does not do IPv6. The rest, even localhost, does ip6 stuff. | |
| net.ipv6.conf.all.disable_ipv6 = 0 | |
| net.ipv6.conf.default.disable_ipv6 = 0 | |
| net.ipv6.conf.lo.disable_ipv6 = 0 | |
| net.ipv6.conf.eth0.disable_ipv6 = 1 | |
| net.ipv6.conf.wan.disable_ipv6 = 1 | |
| # Packet Forwarding |
This is a compiled list of falsehoods programmers tend to believe about working with time.
Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.
| <body> | |
| <div id="⚛️"></div> | |
| <script src="https://unpkg.com/react@16.0.0/umd/react.development.js"></script> | |
| <script src="https://unpkg.com/react-dom@16.0.0/umd/react-dom.development.js"></script> | |
| <script src="https://unpkg.com/babel-standalone@6.26.0/babel.js"></script> | |
| <script type="text/babel"> | |
| ReactDOM.render(<div>Hello World!</div>, document.getElementById('⚛️')) | |
| </script> | |
| </body> |
| /** | |
| * return the mid value among x, y, and z | |
| * @param x | |
| * @param y | |
| * @param z | |
| * @param compare | |
| * @returns {Promise.<*>} | |
| */ | |
| async function getPivot(x, y, z, compare) { | |
| if (await compare(x, y) < 0) { |
UPDATE (Fall 2020): This gist is an updated version to the Windows 10 Fall Creators Update - Installing Node.js on Windows Subsystem for Linux (WSL) guide, I usually just keep here notes, configuration or short guides for personal use, it was nice to know it also helps other ppl, I hope this one too.
Windows updated windows subsystem for linux to version 2, as the F.A.Q stated you can still use WSL version 1 side by side with version 2. I'm not sure about existing WSL machines surviving the upgrade process, but as always backup and 🤞. NOTE: WSL version 1 is not replace/deprecated, and there ar
| ### KERNEL TUNING ### | |
| # Increase size of file handles and inode cache | |
| fs.file-max = 2097152 | |
| # Do less swapping | |
| vm.swappiness = 10 | |
| vm.dirty_ratio = 60 | |
| vm.dirty_background_ratio = 2 |