This file contains 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 type { Config } from "jest" | |
import * as fsPromises from "fs/promises" | |
const setupFilesAfterEnv = async (): Promise<string[]> => { | |
const setupFilesAfterEnvPath = "./tests/helpers/jest/setupFilesAfterEnv/" | |
return (await fsPromises.readdir(`${setupFilesAfterEnvPath}`)).map( | |
fileName => `${setupFilesAfterEnvPath}/${fileName}`, | |
) | |
} |
This file contains 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
local function filename() | |
return vim.fn.expand("%:p") | |
end | |
local function line_number() | |
return vim.api.nvim_win_get_cursor(0)[1] | |
end | |
local function current_directory() | |
return vim.fn.getcwd() |
This file contains 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
-- Change the Diagnostic symbols in the sign column (gutter) | |
-- (not in youtube nvim video) | |
local signs = { Error = "", Warn = "", Hint = "", Info = "" } | |
for type, icon in pairs(signs) do | |
local hl = "DiagnosticSign" .. type | |
vim.fn.sign_define(hl, { text = icon .. " ", texthl = hl, numhl = "" }) | |
end | |
-- Change the diagnostic symbols by the error message | |
vim.diagnostic.config({ |
This file contains 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
brew install telnet | |
telnet towel.blinkenlights.nl |
This file contains 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 React from "react" | |
import * as ReactNative from "react-native" | |
import * as RNTL from "@testing-library/react-native" | |
const formatCompleteOrPartialPhoneNumber = ( | |
phoneNumberDigits: string, | |
): string => { | |
if (phoneNumberDigits.length < 4) { | |
return phoneNumberDigits | |
} else if (phoneNumberDigits.length < 7) { |
This file contains 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 ingredients = [ | |
'Absinthe', | |
'Agave Syrup', | |
'Amaretto Liqueur', | |
'Amaro Liqueur', | |
'Angostura Bitters', | |
'Aperol', | |
'Apple', | |
'Apple Brandy', | |
'Applejack', |
This file contains 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 React from "react" | |
import { | |
AsyncStorage, | |
FlatList, | |
KeyboardAvoidingView, | |
TextInput, | |
TouchableOpacity, | |
Vibration, | |
View, | |
} from "react-native" |
This file contains 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
$ heroku pg:backups:capture -a too-many-men-api | |
$ heroku pg:backups:download -a too-many-men-api | |
$ pg_restore -c -d too_many_men_api_development latest.dump |
This file contains 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 injectedJavascript = [ | |
"setTimeout(function() {", | |
" const metaTag = document.createElement('meta');", | |
" metaTag.setAttribute('name', 'viewport');", | |
" metaTag.setAttribute('content', 'width=device-width, initial-scale=1');", | |
" document.getElementsByTagName('head')[0].appendChild(metaTag);", | |
" setTimeout(function() {", | |
" const documentSize = { displayedMessageContentHeight: document.body.scrollHeight };", |
This file contains 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 { useRef } from "react" | |
const useRefsWithKeys = <T>(): { | |
setRefForKey: (key: string) => (element: T) => void | |
getRefForKey: (key: string) => T | |
} => { | |
const ref = useRef<Record<string, T>>({}) | |
const setRefForKey = | |
(key: string) => |
NewerOlder