• 1 Post
  • 18 Comments
Joined 2 years ago
cake
Cake day: July 18th, 2023

help-circle



  • If you are looking to do something like Github’s Personal Access Tokens (PAT) then it is easiest to just think about it like a password:

    • Create a high entropy (secure) string
    • Store the hash of the string in a database table
    • Store the permissions and other metadata with the PAT’s hash
    • Validate the PAT (permissions, revoke status, etc) on each request to the server

    Storing the hash of the token, like you do with passwords, is a good practice in case your db is ever compromised as it wont leave the tokens accessible and reusable without a lot of effort.







  • The answer depends on the country. In the US, review the Bank Secrecy Act and anti-money laundering (AML) regulations. In Canada, there is the Proceeds of Crime (Money Laundering) and Terrorist Financing Act (PCMLTFA) regulations and also the CRA requiring the individuals and businesses retain their records for up to six years.

    if there’s some sort of way around this either with a lawyer or federal form or something.

    Very unlikely.







  • command! -range -nargs=1 PadColumns call PadColumns(<line1>, <line2>, <args>)
    
    function! PadColumns(start, end, columns)
        execute a:start.','.a:end.'s/\(.*\)\zs\s*$/\='.'repeat(" ", a:columns - len(submatch(1)))'
    endfunction
    

    Use by typing in Normal mode :PadColumns 20. This will add spaces after the line or selected lines to the column you specify (in this case, 20).

    You could probably improve this by getting the length of the longest line and so you dont need to specify the specific column to add spaces to (20), and instead just add say 5 spaces after longest line for all lines.


  • I do not think that this is an existing feature in neovim, however this seems to work :%s/\(.*\)\zs\s*$/\=repeat(' ', 15 - len(submatch(1)))

    Change 15 to the column desired. You could probably create a function where you pass the column number you want so that you dont have to type this string all the time.