Skip to content

Instantly share code, notes, and snippets.

Avatar

Donie Leigh xbot

View GitHub Profile
@xbot
xbot / vimrc_copy_php_full_class_and_method_name
Last active Apr 9, 2021
vimrc that enables copying full class or method name in PHP files.
View vimrc_copy_php_full_class_and_method_name
" 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 / ShortageTest.php
Last active Apr 15, 2021
How to mock laravel DB facade。
View ShortageTest.php
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 / gtkrc-2.0.mine
Last active Jun 22, 2017
gtkrc-2.0.mine for vim fixes
View gtkrc-2.0.mine
# 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"