Skip to content

Instantly share code, notes, and snippets.

View xbot's full-sized avatar

Donie Leigh xbot

View GitHub Profile
@xbot
xbot / gtkrc-2.0.mine
Last active June 22, 2017 13:37
gtkrc-2.0.mine for vim fixes
# fix for gvim border
style "vim-fix" {
bg[NORMAL] = "#002B36" # this matches my gvim theme 'Normal' bg color.
fg[NORMAL] = "#ffffff"
}
style "vim-fix-tabs" {
bg[NORMAL] = shade(1.02, "#656565")
bg[ACTIVE] = shade(1.25, "#878787")
fg[ACTIVE] = "#323232"
@xbot
xbot / ShortageTest.php
Last active January 18, 2022 00:14
How to mock laravel DB facade。
DB::shouldReceive('table')->with('users as u')->once()->andReturnSelf();
DB::shouldReceive('where')->with('u.id', $user->id)->once()->andReturnSelf();
DB::shouldReceive('value')->with('u.favorites_shortages')->once()->andReturn($fakeOldShortages);
@xbot
xbot / vimrc_copy_php_full_class_and_method_name
Last active April 9, 2021 15:31
vimrc that enables copying full class or method name in PHP files.
" Copy full class & method name in php files
" @see https://github.com/tyru/current-func-info.vim
au filetype php command! CopyFullClassName let @+=GetFullPHPClassName() | echo @+ . ' copied.'
au filetype php command! CopyFullMethodName let @+=GetFullPHPMethodName() | echo @+ . ' copied.'
function! GetFullPHPClassName()"{{{
" Save some registers
let l:r_a = @a
let l:r_b = @b
" Save cursor position
@xbot
xbot / surfingkeys
Last active November 13, 2023 09:40
// vi: ft=javascript
const {
Clipboard,
Front,
Hints,
RUNTIME,
Visual,
aceVimMap,
addSearchAlias,
# An example to show how to customize rules while using a subscription link in ClashX
# The following content is that of the file: ~/.config/clash/config.yaml
# Replace SUBSCRIPTION_NAME with your custom name for your subscription.
# Replace SUBSCRIPTION_LINK with your subscription link.
# (HTTP and SOCKS5 in one port)
mixed-port: 7890
# RESTful API for clash
external-controller: 127.0.0.1:9090
allow-lan: false
@xbot
xbot / Caddyfile
Last active October 16, 2022 14:15
A Caddyfile indicating the configurations for subdomains of a wildcard domain and the HTTPS certificate setup with DNS challenge.
*.lab.mydomain.com {
tls {
dns cloudflare {env.CLOUDFLARE_API_TOKEN}
}
@bt host bt.lab.mydomain.com
handle @bt {
reverse_proxy bt:8759
}
@xbot
xbot / neovide.applescript
Last active October 16, 2023 12:18
Open Neovide directly or use Neovide from the 'Open with' menu to open files.
on replace_chars(this_text, search_string, replacement_string)
set AppleScript's text item delimiters to the search_string
set the item_list to every text item of this_text
set AppleScript's text item delimiters to the replacement_string
set this_text to the item_list as string
set AppleScript's text item delimiters to ""
return this_text
end replace_chars
on activate_open_instance(win_title, is_first_time)