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
| local M = {} | |
| ---@return 'main' | 'develop' | |
| local function decide_base_branch() | |
| if vim.fn.system 'git branch --contains develop' == 'error: malformed object name develop' then | |
| return 'main' | |
| end | |
| return 'develop' | |
| 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
| function! project#Switch(path) abort | |
| if tabpagenr('$') == 1 | |
| %bd | |
| endif | |
| execute 'cd ' . a:path | |
| execute 'Dirvish' | |
| endfunction |
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
| function! s:ReturnProjectRoot() abort | |
| " TODO: This doesn't work on non git projects | |
| return system('git rev-parse --show-toplevel')->substitute('\n', '', '') | |
| endfunction | |
| function! github#pr#CreatePr() abort | |
| let l:template_path = s:ReturnProjectRoot() . '/.github/pull_request_template.md' | |
| call execute('tabe ' . tempname()) |
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
| gui: | |
| # stuff relating to the UI | |
| windowSize: 'normal' # one of 'normal' | 'half' | 'full' default is 'normal' | |
| scrollHeight: 2 # how many lines you scroll by | |
| scrollPastBottom: true # enable scrolling past the bottom | |
| scrollOffMargin: 2 # how many lines to keep before/after the cursor when it reaches the top/bottom of the view; see 'Scroll-off Margin' section below | |
| scrollOffBehavior: 'margin' # one of 'margin' | 'jump'; see 'Scroll-off Margin' section below | |
| sidePanelWidth: 0.3333 # number from 0 to 1 | |
| expandFocusedSidePanel: false | |
| mainPanelSplitMode: 'flexible' # one of 'horizontal' | 'flexible' | 'vertical' |
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
| #!/usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| use v5.14; | |
| my $arg = $ARGV[0]; | |
| if ( defined $arg ) { |
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
| #!/usr/bin/env ruby | |
| # Ensure that the 'lib/' directory is in the load path | |
| $LOAD_PATH.unshift(File.expand_path('../lib', __dir__)) | |
| # Load all .rb files in the lib/ directory | |
| Dir[File.expand_path('../lib/*.rb', __dir__)].each { |file| require file } | |
| # Start an IRB session | |
| require 'irb' |
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
| #!/usr/bin/env bash | |
| passwords=$(bw list items | jq '.[] | {id: .id, name: .name}') | |
| selected_password=$(echo "$passwords" | jq -r '.name' | fzf) | |
| selected_password_id=$(echo "$passwords" | jq "select(.name == \"$selected_password\").id" | tr -d '"') | |
| password=$(bw get item "$selected_password_id") | |
| if [[ "$password" != "" ]]; then | |
| echo "Copied password from $selected_password with $(echo "$password" | jq '.login.username') username to clipbord..." |
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
| def reload!(print: true) | |
| puts 'Reloading ...' if print | |
| # Main project directory. | |
| root_dir = Dir.pwd | |
| # Directories within the project that should be reloaded. | |
| reload_dirs = %w[lib app] | |
| # Loop through and reload every file in all relevant project directories. | |
| reload_dirs.each do |dir| | |
| Dir.glob("#{root_dir}/#{dir}/**/*.rb").each { |f| load(f) } | |
| 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
| function! TransformSplitIntoTab() abort | |
| let l:path = expand('%') | |
| call execute(':wq!') | |
| call execute(':tabnew ' . l:path) | |
| endfunction | |
| nnoremap <c-w>! :call TransformSplitIntoTab()<cr> |
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
| " styled.vim Provide refactors for styled-components related components. | |
| function! s:mountStyledConstant(target, original) abort | |
| let l:styled_prefix = 'styled.'.a:original | |
| if a:original =~ '^\u' | |
| let l:styled_prefix = printf('styled(%s)', a:original) | |
| endif | |
| return printf('export const %s = %s``;', a:target, l:styled_prefix) |