| Greedy quantifier | Lazy quantifier | Description |
|---|---|---|
| * | *? | Star Quantifier: 0 or more |
| + | +? | Plus Quantifier: 1 or more |
| ? | ?? | Optional Quantifier: 0 or 1 |
| {n} | {n}? | Quantifier: exactly n |
| {n,} | {n,}? | Quantifier: n or more |
| {n,m} | {n,m}? | Quantifier: between n and m |
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
| # Linux (when in need for read/write on ext* | |
| losetup -Pf --show imageFilePath.img | |
| mount /dev/loop0p1 /mnt/ | |
| # Mac | |
| hdiutil attach -nomount imageFilePath.img | |
| sudo diskutil mountDisk /dev/disk2 | |
| # don't need this anymore... sudo mount -t msdos /dev/disk2s1 /Volumes/somethingsomething |
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
| dd if=/dev/zero of=filewithsecret bs=1 count=12342 conv=notrunc | |
| # ^^^^^- filesize (ls -l filewithsecret) | |
| # ^^^^^- notrunc: do not truncate the file if count is < filesize (do not leave secret bits and bytes hanging around on your disk....) | |
| # Could combine this with a for loop to do it a couple of times if feeling extra |
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 flattenArray = (acc, cur) => acc = [...acc, ...cur] | |
| const queryElement = selector => document.querySelector(selector) | |
| const getAllChildren = elem => elem.children | |
| const removeElem = elem => elem && elem.parentElement.removeChild(elem); | |
| const removeClassFromElem = (elem, styleclass) => elem && elem.classList.remove(styleclass); | |
| const removeClassesFromElem = ([elem, styleclasses]) => styleclasses.forEach(styleclass => removeClassFromElem(elem, styleclass)); | |
| const findAllChildrensExcept = (elemToRemoveExcept) => elemToRemoveExcept | |
| .map(([elem, keepChildrenQueries]) => [queryElement(elem), keepChildrenQueries.map(queryElement)]) |
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
| [%raw "require('isomorphic-fetch')"] | |
| let fetchUrl = "https://adventofcode.com/2019/day/1/input" | |
| let calculateFuel = mass => | |
| mass / 3 - 2 | |
| let add = (i, j) => i + j; | |
| let parseResponse = text => |
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
| import * as ReactRedux from 'react-redux'; | |
| describe('nothing', () => { | |
| let loginFn = jest.fn(() => null); | |
| jest.spyOn(ReactRedux, 'useDispatch').mockImplementation(() => { | |
| return loginFn; | |
| }); | |
| }) |
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
| # search git commits for specific string | |
| git log -S thestring | |
| # search stashes for specific string | |
| git stash list -S thestring |
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
| # Logs | |
| heroku help logs | |
| heroku logs --app=app-name # also for apps in teams (without defining team) | |
| heroku logs --app=pwp-integrated-decameron --num=500 --tail # get 500 last lines and subscribe to future | |
| # Plugins | |
| heroku plugins:install heroku-plugin | |
| heroku plugins:install heroku-builds | |
| heroku help builds |
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
| Desktop safari: | |
| 800x600 | |
| 1366x768 | |
| 1920x1080 |