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
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, UndecidableInstances, FlexibleInstances, EmptyDataDecls #-} | |
data Z | |
data S a | |
__ = __ | |
data T | |
data F | |
class EqNat a b c | a b -> c |
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
commands.addUserCommand(['matrixcode'], '', | |
function(args) { | |
var $LX = plugins.libly.$U.getFirstNodeFromXPath; | |
var $LXs = plugins.libly.$U.getNodesFromXPath; | |
$LXs('//th[@align="left"]').slice(2).forEach(function(t) { | |
var x = t.innerHTML; | |
$LX('../td/input', t).value = liberator.globalVariables.matrix_code[x[1]][x[3]-1]; | |
}); | |
$LX('//input[@type="submit"]').click(); | |
}, null, true); |
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
import Prelude hiding (lookup) | |
type Map k a = k -> Maybe a | |
empty :: Map k a | |
empty = const Nothing | |
insert :: Eq k => k -> a -> Map k a -> Map k a | |
insert k v f = \x -> if x == k then Just v else f x |
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
#include <iostream> | |
#include <tr1/functional> | |
template <typename F, typename G> | |
class on_class | |
: public std::binary_function<typename G::argument_type, | |
typename G::argument_type, typename F::result_type> | |
{ | |
private: | |
F f; |
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
nnoremap <silent> -urls='www\.pixiv\.net/member_illust\.php\?.*illust_id=\d+' b :<C-u>pixivBookmark<Space> | |
nnoremap <silent> -urls='www\.pixiv\.net/member_illust\.php\?.*illust_id=\d+' v :<C-u>pixivViewBookmark<CR> | |
nnoremap <silent> -urls='www\.pixiv\.net/' B :<C-u>pixivUserBookmark<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
(function() { | |
const FORMAT_INFO = { | |
5: { | |
desc: 'flv1+mp3 360p', | |
ext: 'flv', | |
}, | |
18: { | |
desc: 'h264+aac 360p', | |
ext: 'mp4', | |
}, |
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:encodeURIComponent(str) | |
let s = '' | |
for i in range(strlen(a:str)) | |
let c = a:str[i] | |
if c =~# "[A-Za-z0-9-_.!~*'()]" | |
let s .= c | |
else | |
let s .= printf('%%%02X', char2nr(a:str[i])) | |
endif | |
endfor |
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
commands.addUserCommand(['hseval'], 'evaluate haskell expression', | |
function(args) { | |
util.httpGet('http://tryhaskell.org/haskell.json?method=eval&expr=' + encodeURIComponent(args.literalArg), function(res) { | |
let json = JSON.parse(res.responseText); | |
if (json.error) { | |
liberator.echoerr('error: ' + json.error); | |
} else if (json.exception) { | |
liberator.echoerr('exception: ' + json.exception); | |
} else { | |
liberator.echo(json.result + ' :: ' + json.type); |
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
" A .vimrc snippet that allows you to move around windows beyond tabs | |
nnoremap <silent> <Tab> :<C-u>call <SID>NextWindowOrTab()<CR> | |
nnoremap <silent> <S-Tab> :<C-u>call <SID>PreviousWindowOrTab()<CR> | |
function! s:NextWindowOrTab() | |
if winnr() < winnr("$") | |
wincmd w | |
else | |
tabnext |
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
" Capture {{{ | |
command! | |
\ -nargs=+ | |
\ -complete=command | |
\ Capture | |
\ call s:cmd_capture([<f-args>]) | |
function! s:capture(cmd) | |
redir => result | |
silent execute a:cmd |