Skip to content

Instantly share code, notes, and snippets.

View itchyny's full-sized avatar
🏠
Working from home

itchyny itchyny

🏠
Working from home
  • Cybozu, Inc.
  • Kyoto, Japan
View GitHub Profile
This file has been truncated, but you can view the full file.
[
{'a:keyword_pattern': ' \%(adverb\|conjunction\|dyad\|monad\|noun\|verb\) ', 'a:prefix': ''},
{'a:prefix': '', 'end': 48, 'i': 1, 'original_pattern': ' \%(adverb\|conjunction\|dyad\|monad\|noun\|verb\) ', 'pattern': ' '},
{'a:keyword_pattern': 'adverb\|conjunction\|dyad\|monad\|noun\|verb', 'a:prefix': ' '},
{'a:keyword_pattern': ' \%(Note\|\%(assert\|break\|do\)\.\@!\) ', 'a:prefix': ''},
{'a:prefix': '', 'end': 37, 'i': 1, 'original_pattern': ' \%(Note\|\%(assert\|break\|do\)\.\@!\) ', 'pattern': ' '},
{'a:keyword_pattern': 'Note\|\%(assert\|break\|do\)\.\@!', 'a:prefix': ' '},
{'a:prefix': ' ', 'end': 20, 'i': 0, 'original_pattern': '\%(assert\|break\|do\)\.\@!', 'pattern': ''},
{'a:keyword_pattern': 'assert\|break\|do', 'a:prefix': ''},
{'a:keyword_pattern': '"\|`:\| \|&\.:\| \%( \.\| :\)', 'a:prefix': ''},
FUNCTION neocomplete#variables#get_source()
Called 1 time
Total time: 0.000028
Self time: 0.000028
count total (s) self (s)
1 0.000010 if !exists('s:sources')
let s:sources = {}
endif
1 0.000010 return get(s:sources, a:name, {})
FUNCTION neocomplete#custom#get()
Called 8 times
Total time: 0.000206
Self time: 0.000206
count total (s) self (s)
8 0.000060 if !exists('s:custom')
let s:custom = {}
let s:custom.sources = {}
let s:custom.sources._ = {}
@itchyny
itchyny / incsearch-hlall.diff
Last active August 29, 2015 14:14
incsearch-hlall.diff
diff -r cd5eff09c1ae src/ex_getln.c
--- a/src/ex_getln.c Thu Feb 05 20:29:59 2015 +0100
+++ b/src/ex_getln.c Sat Feb 07 02:09:58 2015 +0900
@@ -1778,8 +1778,10 @@
curwin->w_cursor = old_cursor; /* start at old position */
/* If there is no command line, don't do anything */
- if (ccline.cmdlen == 0)
+ if (ccline.cmdlen == 0) {
i = 0;
snippet test
test1 ->
test2
@itchyny
itchyny / battery.sh
Last active August 29, 2015 14:23
Mac Battery metric for Mackerel
#!/bin/bash
if [ x$MACKEREL_AGENT_PLUGIN_META = x1 ]; then
cat << EOF
# mackerel-agent-plugin
{
"graphs": {
"battery": {
"label": "Battery",
"unit": "percentage",
@itchyny
itchyny / cpu-temperature.sh
Last active August 29, 2015 14:24
CPU Temperature metric for Mackerel
#!/bin/bash
if ! [ -f /usr/local/bin/osx-cpu-temp 1>/dev/null 2>&1 ]; then
brew install https://raw.githubusercontent.com/tasuten/homebrew-myformulas/master/osx-cpu-temp.rb > /dev/null 2>&1
fi
if [ x$MACKEREL_AGENT_PLUGIN_META = x1 ]; then
cat << EOF
# mackerel-agent-plugin
{
@itchyny
itchyny / weather.sh
Last active December 12, 2015 14:39
Weather metric for Mackerel
#!/bin/bash
pos=Kyoto,jp
units=metric
appid=
url="http://api.openweathermap.org/data/2.5/weather?q=$pos&units=$units&APPID=$appid"
res=$(/usr/bin/curl -m 5 -s "$url")
time=$(date +%s)
curl https://mackerel.io/api/v0/services/SERVICE/tsdb \
diff --git a/autoload/vital/__latest__/Data/String.vim b/autoload/vital/__latest__/Data/String.vim
index 6d28383..7915ba9 100644
--- a/autoload/vital/__latest__/Data/String.vim
+++ b/autoload/vital/__latest__/Data/String.vim
@@ -455,6 +455,50 @@ function! s:truncate(str, width) abort
return ret
endfunction
+function! s:truncate_mattn(str, width) abort
+ " Original function is from mattn.
function! s:evaluate_expand(component) abort
try
let result = eval(a:component . '()')
if type(result) == type('') && result ==# ''
return []
endif
catch
return []
endtry
return map(type(result) == 3 ? (result + [[], [], []])[:2] : [[], [result], []], 'filter(s:normalize(v:val), "v:val !=# ''''")')