Removes the current path.
Visistor:
interface MyCompProps { | |
model: Model; | |
modParams: ModParams; | |
} | |
interface MyCompState { | |
derived1?: Derived1; | |
derived2?: Derived2; | |
initialized: boolean; |
On OS X the Packed Pixels display won't automatically show up as "Retina" or "HiDPI" resolution, instead the OS will use the full resolution of the display making everything tiny. This can be changed using the 3rd party app (non-free) SwitchResX.
First, download SwitchResX.
You can play with the resolutions for the Packed Pixels which is probably listed as Color LCD (2). However not all of the HiDPI resolutions work due to an OS X bug. If you are happy with any of the ones that do work then stop here, else continue.
If you're on El Capitan or later you need to disable System Integrity Protection (temporarily) to add a custom resolution for Packed Pixels. Follow the instructions from SwitchResX creator.
Now add a Custom Resolution that is "scaled". It must be 2 pixels bigger or smaller than the native resolution in one direction (this is the OS X quirk). I found bigger makes it slightly blurry so go w
// See http://www.bluejava.com/4NS/Speed-up-your-Websites-with-a-Faster-setTimeout-using-soon | |
// This is a very fast "asynchronous" flow control - i.e. it yields the thread and executes later, | |
// but not much later. It is far faster and lighter than using setTimeout(fn,0) for yielding threads. | |
// Its also faster than other setImmediate shims, as it uses Mutation Observer and "mainlines" successive | |
// calls internally. | |
// WARNING: This does not yield to the browser UI loop, so by using this repeatedly | |
// you can starve the UI and be unresponsive to the user. | |
// This is an even FASTER version of https://gist.github.com/bluejava/9b9542d1da2a164d0456 that gives up | |
// passing context and arguments, in exchange for a 25x speed increase. (Use anon function to pass context/args) | |
var soon = (function() { |
// Mixin like functionality | |
const textInput = props => ` | |
color: ${props.error ? color.white : color.base}; | |
background-color: ${props.error ? color.alert : color.white}; | |
`; | |
export const Input = styled.input` | |
${textInput} | |
`; |
git log -n 10\ | |
--pretty=format:'{"commit": "%H", "author": "%aN <%aE>", "date": "%ai", "message": """%B""", "notes": """%N""" },' \ | |
$@ | awk 'BEGIN { print("[") } { print($0) } END { print("]") }' | python -u -c \ | |
'import ast,json,sys; print(json.dumps(ast.literal_eval(sys.stdin.read())))' |
gatsby-config.js
onPreBootstrap
if it is implemented in any plugins, for example gatsby-plugin-typography. Receives handy [apiCallArgs](https://github.com/gatsbyjs/gatsby/blob/ffd8b2d691c9/** resolve.exports but for imports */ | |
/** | |
* @param {object} imports | |
* @param {Set<string>} keys | |
*/ | |
function loop(imports, keys) { | |
if (typeof imports === 'string') { | |
return imports; | |
} |
To be able to purge safely unused tailwind classes from the build (https://tailwindcss.com/docs/controlling-file-size)
The idea here is simple: we're going to purge css on the app side + whitelist classes that component library is using.
I had a problem with go get
using private repository on gitlab from our company.
I lost a few minutes trying to find a solution.... and I did find one:
You need to get a private token at:
https://gitlab.mycompany.com/profile/account
Configure you git to add extra header with your private token:
$ git config --global http.extraheader "PRIVATE-TOKEN: YOUR_PRIVATE_TOKEN"