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
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
#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
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
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
{-# 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
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) |
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
#!/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 | |
} |
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 TypeFamilies, EmptyDataDecls, TypeOperators, UndecidableInstances #-} | |
data Z | |
data S n | |
data Nil | |
data x :<: xs | |
infixr 5 :<: | |
data Yes | |
data No |
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 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 |