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
| -- Copy file path / selection reference for pasting into AI chats | |
| local function copy_ref(opts) | |
| -- "%" is the current buffer's file name; ":." makes it relative to the cwd | |
| local path = vim.fn.expand("%:.") | |
| -- ref is what ends up in the clipboard; start with just the path | |
| local ref = path | |
| if opts.visual then | |
| -- '< and '> are only set after leaving visual mode, so read the live selection: | |
| -- "v" is the line where visual mode was started (the anchor) |
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
| // Place your key bindings in this file to override the defaults | |
| [ | |
| // terminal toggle | |
| { | |
| "key": "f12", | |
| "command": "workbench.action.terminal.toggleTerminal", | |
| }, | |
| // terminal navigation | |
| { | |
| "key": "ctrl+1", |
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
| -- highlight yank | |
| vim.api.nvim_create_autocmd("TextYankPost", { | |
| group = vim.api.nvim_create_augroup("highlight_yank", { clear = true }), | |
| pattern = "*", | |
| desc = "highlight selection on yank", | |
| callback = function() | |
| vim.highlight.on_yank({ timeout = 200, visual = true }) | |
| end, | |
| }) |
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
| vim.opt.number = true | |
| vim.opt.relativenumber = true | |
| vim.opt.tabstop = 2 | |
| vim.opt.softtabstop = 2 | |
| vim.pack.add({ | |
| { src = "https://github.com/neovim/nvim-lspconfig" }, | |
| { src = "https://github.com/mason-org/mason.nvim" }, | |
| { src = "https://github.com/mason-org/mason-lspconfig.nvim" }, | |
| { src = "https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim" }, |
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
| vim.opt.number = true | |
| vim.opt.relativenumber = true | |
| vim.opt.tabstop = 2 | |
| vim.opt.softtabstop = 2 | |
| vim.pack.add({ | |
| { src = "https://github.com/neovim/nvim-lspconfig" }, | |
| { src = "https://github.com/mason-org/mason.nvim" }, | |
| { src = "https://github.com/mason-org/mason-lspconfig.nvim" }, | |
| { src = "https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim" }, |
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
| vim.pack.add { | |
| { src = 'https://github.com/neovim/nvim-lspconfig' }, | |
| { src = 'https://github.com/mason-org/mason.nvim' }, | |
| { src = 'https://github.com/mason-org/mason-lspconfig.nvim' }, | |
| { src = 'https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim' }, | |
| } | |
| require('mason').setup() | |
| require('mason-lspconfig').setup() | |
| require('mason-tool-installer').setup({ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| import java.util.Random; | |
| import java.util.ArrayList; | |
| import java.util.Arrays; | |
| public class Magic8{ | |
| // Magic 8 Ball usually has a 20 sided dice inside with 10 positive dice sides, 5 negative dice sides and 5 vague responses | |
| // Below defines positive/negative/vague responses | |
| ArrayList<String> positiveResponses = new ArrayList<String> (Arrays.asList("As I see it yes", "It is certain", "It is decidedly so", "Most likely", "Outlook good", "Signs point to yes", "Without a doubt", "You may rely on it", "Yes definitely", "Absolutely")); |
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
| // Program is designed to check if a DNA Sequence is a protein, it does this by checking if it contains ATG, contains TGA at some point after ATG and the characters inbetween are divisible by 3 | |
| public class DNA{ | |
| public boolean isProtein(String dna){ | |
| // The begins and ends variables find the index value of where ATG starts and the index value of where TGA starts + 3 so we get the value of where it ends | |
| int begins = dna.indexOf("ATG"); | |
| int ends = (dna.indexOf("TGA")) + 3; | |
| // The string newDna now will hold the new string starting with ATG and ending with TGA cutting out anything before or after in the original string |
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
| import java.util.ArrayList; | |
| class PrimeDirective { | |
| /* This checks if the number is prime by first checking if the number is 0 or less than 0, which makes it not prime. | |
| It then checks if the number is divisible by every number from 3 to itself -1, if it is divisible it sets the return as false as it cannot be a prime number, it it is not the value remains as true */ | |
| public boolean isPrime(int num){ | |
| boolean value = true; |
NewerOlder