npx create-react-app@next --scripts-version=@next --template=cra-template@next my-js-app
npx create-react-app@next --scripts-version=@next --template=typescript@next my-ts-app
[Bottle] | |
- Damage: 10 | |
- Range: 7.5 | |
[BrokenBottle] | |
- Damage: 14 | |
- Range: 7 | |
[Chair] | |
- Damage: 18 |
#!/usr/bin/env bash | |
# | |
# Use rofi to pick emoji because that's what this | |
# century is about apparently... | |
# | |
# Requirements: | |
# rofi, xsel, xdotool, curl, xmllint | |
# | |
# Usage: | |
# 1. Download all emoji |
You may want a linter plugin to lint your code in Vim but you probably don't need it. At least try the built-in way before jumping on the plugin bandwagon.
autocmd FileType <filetype> setlocal makeprg=<external command>
This autocommand tells Vim to use <external command>
when invoking :make %
in a <filetype>
buffer. You can add as many similar lines as needed for other languages.
[I'm an inline-style link](https://www.somewebsite.com) | |
[I'm an inline-style link with title](https://www.somewebsite.com "somewebsite's Homepage") | |
[I'm a reference-style link][Arbitrary case-insensitive reference text] | |
[I'm a relative reference to a repository file](../blob/master/LICENSE) | |
[You can use numbers for reference-style link definitions][1] |
https://gist.github.com/ljharb/58faf1cfcb4e6808f74aae4ef7944cff
While attempting to explain JavaScript's reduce
method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.
JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List
is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it mu
" Statusline (requires Powerline font) | |
set statusline= | |
set statusline+=%(%{&buflisted?bufnr('%'):''}\ \ %) | |
set statusline+=%< " Truncate line here | |
set statusline+=%f\ " File path, as typed or relative to current directory | |
set statusline+=%{&modified?'+\ ':''} | |
set statusline+=%{&readonly?'\ ':''} | |
set statusline+=%= " Separation point between left and right aligned items | |
set statusline+=\ %{&filetype!=#''?&filetype:'none'} | |
set statusline+=%(\ %{(&bomb\|\|&fileencoding!~#'^$\\\|utf-8'?'\ '.&fileencoding.(&bomb?'-bom':''):'') |
<hash>
with your gist's hash):
# with ssh
git clone [email protected]:<hash>.git mygist
# with https
git clone https://gist.github.com/.git mygist
To create anchor links that jump down to different sections of a README (as in an interactive table of contents), first create a heading:
#Real Cool Heading
The anchor link for that heading is the lowercase heading name with dashes where there are spaces. You can always get the anchor name by visiting the README on Github.com and clicking on the anchor that appears when you hover to the left of the heading. Copy everything starting at the #:
#real-cool-heading
Wherever you want to link to your Real Cool Heading section, put your desired text in brackets, followed by the anchor link in parentheses:
[Go to Real Cool Heading section](#real-cool-heading)