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
-- Vim split hotkeys | |
vim.keymap.set("n", "<leader>d|", "<C-w>v", { desc = "Split window vertically" }) | |
vim.keymap.set("n", "<leader>d_", "<C-w>s", { desc = "Split window horizontally" }) | |
-- <leader>+ toggles maximizing the current pane, like tmux | |
_G.toggle_session = function() | |
local session_file = "/tmp/vim_session_" .. vim.fn.getpid() .. ".vim" | |
if vim.fn.filereadable(session_file) == 1 then | |
vim.cmd("silent! source " .. session_file) | |
vim.fn.delete(session_file) |
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
-- Rename tmux window when nvim opens | |
if vim.fn.exists("$TMUX") == 1 then | |
local function rename_tmux_tab() | |
local cwd = vim.fn.fnamemodify(vim.fn.getcwd(), ":t") | |
vim.fn.system('tmux rename-window "' .. cwd .. '"') | |
end | |
local function reset_tmux_tab() | |
vim.fn.system("tmux set-window-option automatic-rename on") | |
end |
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 |
NewerOlder