Skip to content

Instantly share code, notes, and snippets.

@hidez8891
hidez8891 / test.md
Last active August 30, 2016 09:30
Markdown test

check box

  • unchecked
  • checked
@hidez8891
hidez8891 / stream.cpp
Created January 22, 2016 11:10
C++ pipe stream
#include <iterator>
#include <type_traits>
#include <vector>
#include <algorithm>
// operator
template <typename C, typename F>
auto operator| (C c, F f)
{
return f(c.begin(), c.end());
@hidez8891
hidez8891 / curry.cpp
Created January 21, 2016 12:31
C++ curried function
// (a0 -> a1 -> ... -> r) -> (a0 -> (a1 -> ... -> r))
template <typename F>
auto curry_1(F f)
{
return [f](auto a) {
return [f, a](auto... args) {
return f(a, args...);
};
};
}
@hidez8891
hidez8891 / ParseFormula.hs
Last active August 31, 2015 13:08
逆ポーランド形式に変換するだけ
import Text.ParserCombinators.Parsec
import qualified Text.ParserCombinators.Parsec.Token as TokenSymbols
import Text.ParserCombinators.Parsec.Language
{-
data Impl
-}
data Impl = ImplNum Integer | ImplSym String | ImplOp String
deriving Show
@hidez8891
hidez8891 / tlang.cpp
Created January 31, 2015 15:40
tlang | c like language made from c++ template language
#include <tuple>
namespace tuple
{
// concat
template <typename, typename>
struct concat;
// concat: tuple -> tuple -> tuple
template <typename... Ts1, typename... Ts2>
struct concat<std::tuple<Ts1...>, std::tuple<Ts2...>>
"autocmd GUIEnter * set transparency=220
" default colorscheme
colorscheme murphy
" change default directory
if has("win32") || has("win64")
cd D:\hide\Documents\workspace
endif
@hidez8891
hidez8891 / gist:7730275
Last active December 29, 2015 21:29
JRubyFXでドラッグ・アンド・ドロップが出来たので
require 'java'
require 'jrubyfx'
class App < JRubyFX::Application
def start(stage)
with(stage, width: 800, height: 600, title: 'Converter') do
ui_text = nil
layout_scene do
vbox do