Skip to content

Instantly share code, notes, and snippets.

View eagletmt's full-sized avatar

Kohei Suzuki eagletmt

View GitHub Profile
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, UndecidableInstances, FlexibleInstances, EmptyDataDecls #-}
data Z
data S a
__ = __
data T
data F
class EqNat a b c | a b -> c
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);
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
#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;
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>
(function() {
const FORMAT_INFO = {
5: {
desc: 'flv1+mp3 360p',
ext: 'flv',
},
18: {
desc: 'h264+aac 360p',
ext: 'mp4',
},
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
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);
" 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
@eagletmt
eagletmt / .vimrc
Created April 27, 2010 10:55 — forked from Shougo/.vimrc
" Capture {{{
command!
\ -nargs=+
\ -complete=command
\ Capture
\ call s:cmd_capture([<f-args>])
function! s:capture(cmd)
redir => result
silent execute a:cmd