Primeiro adicione o repositório do certbot com o seguinte comando:
add-apt-repository ppa:certbot/certbot
Em seguida instale o certbot e o plugin para o Nginx:
type Optional<T, K extends keyof T> = Omit<T, K> & Partial<T>; | |
type Test = { | |
foo: string, | |
bar: string, | |
baz: string, | |
daz?: string, | |
} | |
type Test1 = Optional<Test, 'foo'> |
const asyncHandler = (fn) => ( | |
(req, res, next) => { | |
Promise.resolve(fn(req, res, next)) | |
.catch(next) | |
} | |
) | |
export default asyncHandler |
/** | |
* Scenario: | |
* The user requests an account sync | |
* Given the account | |
* And the institution of account | |
* And the user of account | |
* When the user requests the account sync | |
* Then a sync is scheduled | |
* And the sync scheduled event is created | |
*/ |
const capitalize = (string = '') => { | |
if (toString.call(string) !== '[object String]') { | |
return '' | |
} | |
const name = string.split(' ')[0] | |
return name.charAt(0).toUpperCase() + name.slice(1) | |
} |
const cleanup = async () => { | |
try { | |
console.log('Cleaning up') | |
} catch (error) { | |
console.error(error) | |
process.exit(1) | |
} | |
} | |
const start = async () => { |
const start = async () => { | |
throw new Error('Failed to start!') | |
} | |
start() | |
.catch(async err => { | |
// Precisa de async no catch pra fazer upload de alguma coisa por exemplo... | |
// Mas por ser async, pode por sua vez dar erro também... | |
// Então throw novamente... | |
throw new Error('Failed to catch start error!') |
// Implementation of Kotlin `String.toByteArray` in JavaScript | |
// https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/to-byte-array.html | |
const UTF8ByteArrayFromString = (string) => { | |
const encoder = new TextEncoder() | |
return encoder.encode(string) | |
} | |
const stringFromUTF8ByteArray = (array) => { | |
const decoder = new TextDecoder() |
const start = async () => { | |
try { | |
throw new Error('Failed to start!') | |
} catch (err) { | |
await somethingThrows() | |
} | |
} | |
start() | |
.catch(err => { |
{ | |
"[csv]": { | |
"files.encoding": "windows1252" | |
}, | |
"[javascript]": { | |
"editor.formatOnSave": true, | |
"editor.defaultFormatter": "esbenp.prettier-vscode" | |
}, | |
"[javascriptreact]": { | |
"editor.formatOnSave": false |