Make your zsh
better in a few short steps 🚀
Use oh-my-zsh:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Install spaceship-prompt:
# download:
Make your zsh
better in a few short steps 🚀
Use oh-my-zsh:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Install spaceship-prompt:
# download:
Memoization is a somewhat fraught topic in the React world, meaning that it's easy to go wrong with it, for example, by [making memo()
do nothing][memo-pitfall] by passing in children to a component. The general advice is to avoid memoization until the profiler tells you to optimize, but not all use cases are general, and even in the general use case you can find tricky nuances.
Discussing this topic requires some groundwork about the technical terms, and I'm placing these in once place so that it's easy to skim and skip over:
// Logiops (Linux driver) configuration for Logitech MX Master 3. | |
// Includes gestures, smartshift, DPI. | |
// Tested on logid v0.2.2-35-g1c209ed. | |
// File location: /etc/logid.cfg | |
devices: ({ | |
name: "Wireless Mouse MX Master 3"; | |
smartshift: { |
``` | |
import postcss from 'rollup-plugin-postcss'; | |
import genericNames from 'generic-names'; | |
// ... | |
postcss({ | |
extract: true, | |
modules: { | |
// Special scoped name generation function used to sync |
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
''' | |
This is a little script to download every song from every playlist | |
if your Google Play Music account. Songs are organized as follows: | |
<playlist>/<artist>/<album>/<song>.mp3 | |
I Highly recomend putting this file in your %USER%\Music folder | |
before running. |
import * as React from 'react'; | |
import SomeContext from './SomeContext.jsx'; | |
const App = () => ( | |
<SomeContext.Provider value={{ foo: 'bar' }}> | |
<App /> | |
</SomeContext.Provider> | |
); | |
export default App; |
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common | |
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev libncurses5-dev libatk1.0-dev libx11-dev libxpm-dev libxt-dev | |
#Optional: so vim can be uninstalled again via `dpkg -r vim` | |
sudo apt-get install checkinstall | |
sudo rm -rf /usr/local/share/vim /usr/bin/vim | |
cd ~ |
I hereby claim:
To claim this, I am signing this object:
// getComponent is a function that returns a promise for a component | |
// It will not be called until the first mount | |
function asyncComponent(getComponent) { | |
return class AsyncComponent extends React.Component { | |
static Component = null; | |
state = { Component: AsyncComponent.Component }; | |
componentWillMount() { | |
if (!this.state.Component) { | |
getComponent().then(Component => { |
// Custom webpack loader which simply removes any use of 'composes'. | |
// This is because this bug https://github.com/istarkov/babel-plugin-webpack-loaders/issues/97 | |
// causing issues with testing. | |
module.exports = function removeComposes(source) { | |
if (process.env.NODE_ENV === 'test') { | |
const hasComposes = source.indexOf('composes') > 0; | |
if (!hasComposes) return source; | |
var numOfOccurences = source.match(/composes/g).length; |