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
# Renderman Shading Language | |
# http://twitter.com/Phize/status/122033158265901056 | |
float pblend(float c1; float c2; string mode) { | |
float result = 0.0; | |
float d = 0.0; | |
if (mode == "normal") { | |
result = c2; | |
} |
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
" Ctags (patch): http://designtomarkup.com/vim/taglist-ctags-css-patch | |
" Tagbar : https://github.com/majutsushi/tagbar | |
" Screenshot : http://twitpic.com/7zq4d7 | |
"Tagbar | |
noremap <silent> <Leader>t :<C-u>TagbarToggle<CR> | |
let g:tagbar_type_css = { | |
\ 'ctagstype' : 'Css', | |
\ 'kinds' : [ |
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
<?php | |
function my_get_template_part( $slug, $name = null, $vars = [] ) { | |
do_action( 'get_template_part_' . $slug, $slug, $name ); | |
$templates = []; | |
$name = (string) $name; | |
if ( $name !== '' ) { | |
$templates[] = $slug . '-' . $name . '.php'; | |
} |
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
function phptal_tales_notEmpty($src, $nothrow) { | |
$src = trim($src); | |
if (ctype_alnum($src)) return 'isset($ctx->' . $src . ') && "" !=== $ctx->' . $src; | |
return '(null !== ($path = $ctx->path($ctx,' . PHPTAL_Php_TalesInternal::string($src) . ', true)) && "" !== $path)'; | |
} |
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
function git_repository_basename() { | |
local _repository_basename | |
if [ $(git rev-parse --is-bare-repository) = 'true' ]; then | |
_repository_basename=$(basename $(git rev-parse --show-toplevel)) | |
_repository_basename=${_repository_basename%.git} | |
else | |
_repository_basename=$(basename $(readlink -nf $(git rev-parse --show-toplevel))) | |
fi |
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
" ************************************************** | |
" Gist {{{ | |
" ************************************************** | |
" dictionary of Gist accounts. | |
let g:gist_accounts = { | |
\ 'user1': { | |
\ 'password': 'password' | |
\ }, | |
\ 'user2': { | |
\ 'password': 'password' |
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
" return regexp pattern that matches a comment based on commentstring. | |
function! s:getCommentStringPattern() | |
let pattern = escape(&commentstring, '^$[].*\~ ') | |
let pattern = substitute(pattern, '%s', '.*', 'g') | |
return pattern | |
endfunction | |
" align comment(s) based on commentstring. | |
autocmd vimrc-autocmd BufEnter * |
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
My Vim files have moved to https://github.com/Phize/vim |
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
autocmd BufFilePost \[ref-*:*\] call Pl#UpdateStatusline(1) | |
call Pl#Statusline( | |
\ Pl#Match('bufname("%")', '^\[ref-(.+):(.*)\]$'), | |
\ | |
\ Pl#Segment(' %{"Ref"} ', | |
\ Pl#HiCurrent( Pl#FG(231), Pl#BG(240), Pl#Attr('bold')), | |
\ Pl#HiInsert( Pl#FG(231), Pl#BG( 31), Pl#Attr('bold')), | |
\ Pl#HiNonCurrent(Pl#FG(244), Pl#BG(234), Pl#Attr('bold')) | |
\ ), |
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
call Pl#Statusline( | |
\ Pl#Match('bufname("%")', '^\*unite\* - .*\@\d+$'), | |
\ | |
\ Pl#Segment(' %{"Unite"} ', | |
\ Pl#HiCurrent( Pl#FG(231), Pl#BG(240), Pl#Attr('bold')), | |
\ Pl#HiInsert( Pl#FG(231), Pl#BG( 31), Pl#Attr('bold')), | |
\ Pl#HiNonCurrent(Pl#FG(244), Pl#BG(234), Pl#Attr('bold')) | |
\ ), | |
\ | |
\ Pl#Segment('%< %{substitute(bufname("%"), "\^\\v\\*unite\\* - \(\.\+\)\\@\\d\+\$", "\\u\\1", "")} list', |
NewerOlder