Skip to content

Instantly share code, notes, and snippets.

View eagletmt's full-sized avatar

Kohei Suzuki eagletmt

View GitHub Profile
(function() {
const FORMAT_INFO = {
5: {
desc: 'flv1+mp3 360p',
ext: 'flv',
},
18: {
desc: 'h264+aac 360p',
ext: 'mp4',
},
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>
#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;
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
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);
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, UndecidableInstances, FlexibleInstances, EmptyDataDecls #-}
data Z
data S a
__ = __
data T
data F
class EqNat a b c | a b -> c
import Data.Array
import Data.Array.IArray (IArray)
import Data.Array.Unboxed (UArray)
import Data.Array.ST (STArray, thaw, freeze)
import Control.Monad.ST (ST, runST)
coerce :: (Ix i, IArray a e, IArray b e) => a i e -> b i e
coerce arr = runST $ thawST arr >>= freeze
where
thawST :: (Ix i, IArray a e) => a i e -> ST s (STArray s i e)
#!/usr/bin/env ruby1.9
# coding: utf-8
input = ARGF.gets.chomp
# 24 区切りに分ける
points = [0] * 10
input.each_byte { |c|
points[(268-c)/24] += 1
}
{-# LANGUAGE TypeFamilies, EmptyDataDecls, TypeOperators, UndecidableInstances #-}
data Z
data S n
data Nil
data x :<: xs
infixr 5 :<:
data Yes
data No
import Data.Maybe (fromJust)
import Codec.Binary.UTF8.String (encodeString)
import Network.URI (URI, parseURI)
import Network.Browser
import Network.HTTP
tweet :: HStream ty => String -> String -> String -> IO (Response ty)
tweet user pass status = browse $ do
setOutHandler (const (return ()))
addAuthority auth