Skip to content

Instantly share code, notes, and snippets.

@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
"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 / 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...>>
@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 / 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 / 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 / test.md
Last active August 30, 2016 09:30
Markdown test

check box

  • unchecked
  • checked
@hidez8891
hidez8891 / autoup.go
Created September 20, 2016 14:39
auto version string updater for Golang
package main
import (
"fmt"
"go/ast"
"go/parser"
"go/token"
"io/ioutil"
"os"
"strconv"
@hidez8891
hidez8891 / Dockerfile
Created October 21, 2017 12:34
Docker for golang with neovim
FROM golang
RUN apt-get update && apt-get install -y \
neovim \
python3 \
python3-pip \
&& rm -rf /var/lib/apt/lists/* \
&& pip3 install --upgrade neovim \
&& mkdir -p /root/.config/nvim \
&& go get -u github.com/nsf/gocode \
@hidez8891
hidez8891 / itc2extractor.go
Last active November 12, 2017 10:42
itc2 (iTunes Artworks Cache Format) extractor
package main
import (
"fmt"
"image"
"image/color"
"image/jpeg"
"io"
"os"