| 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
    
  
  
    
  | (() => { | |
| 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
    
  
  
    
  | 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
    
  
  
    
  | # 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
    
  
  
    
  | # from https://stackoverflow.com/questions/5163144/what-are-the-special-dollar-sign-shell-variables | |
| # Aslo see https://www.gnu.org/software/bash/manual/html_node/Special-Parameters.html | |
| $1# (, $2, $3 , ...) are the positional parameters. | |
| "$@" # is an array-like construct of all positional parameters, {$1, $2, $3 ...}. | |
| "$*" # is the IFS expansion of all positional parameters, $1 $2 $3 .... | |
| $# # is the number of positional parameters. | |
| $- # current options set for the shell. | |
| $$ # pid of the current shell (not subshell). | |
| $_ # most recent parameter (or the abs path of the command to start the current shell immediately after startup). | 
  
    
      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
    
  
  
    
  | xattr -d com.apple.quarantine file-downloaded-with-Mail-app-fx.txt | 
  
    
      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 linkPath = '/workingMode/distracted/aBit' | |
| const isDarkTheme = true | |
| const generateSearchQuery = (strings, linkExp, searchArgument = 'gaveUp') => { | |
| let searchQuery = '?search=' | |
| const [,searchQueryArg ,] = strings | |
| const themeString = isDarkTheme ? 'dark' : 'light' | |
| if (searchQueryArg !== '') searchQuery = searchQueryArg | |
| return `/en-us${linkExp}${searchQuery}${searchArgument}?themeType=${themeString}` | 
  
    
      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
    
  
  
    
  | // From https://davidwalsh.name/javascript-tricks | |
| /** | |
| Those three dots made the task so much easier! | |
| Require Function Parameters | |
| Being able to set default values for function arguments was an awesome addition to JavaScript, but check out this trick for requiring values be passed for a given argument: | |
| */ | |
| const isRequired = () => { throw new Error('param is required'); }; | 
  
    
      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
    
  
  
    
  | jq .repository package.json |