Skip to content

Instantly share code, notes, and snippets.

@wreulicke
wreulicke / test.cpp
Created July 11, 2016 08:44
C++ memo
#include <iostream>
#include <vector>
#include <initializer_list>
#include <type_traits>
#include <algorithm>
using namespace std;
template <typename T,size_t n=0>
vector<enable_if_t<is_arithmetic<T>::value,T>> data(){
size_t x=n;
https://www.evernote.com/shard/s283/sh/8a7acc0d-e72e-4846-a862-2d1daa37e686/4ab563c0eb116a2806275effd97aa34d
package test.jpa;
import java.lang.reflect.Field;
import com.orientechnologies.orient.core.metadata.schema.OClass;
import com.tinkerpop.blueprints.impls.orient.OrientGraph;
import com.tinkerpop.blueprints.impls.orient.OrientVertex;
import com.tinkerpop.blueprints.impls.orient.OrientVertexType;
public class VertexRegisterImpl implements VertexRegister{
@wreulicke
wreulicke / Predict.ts
Last active August 28, 2016 15:43
Promise
export type predicate= (...args: any[]) => boolean
const AND = (...predicates: predicate[]) =>
(...args: any[]) => predicates.every(predicate => predicate(...args));
const OR = (...predicates: predicate[]) =>
(...args: any[]) => predicates.some(predicate => predicate(...args));
const NOT = (predicate: predicate) => (...args: any[]) => !predicate(...args);
const EVERY = AND;
@wreulicke
wreulicke / test.md
Created September 6, 2016 18:51
kobitoのチートシート

Markdownチートシート Kobitoでは、プレーンテキストを手軽に装飾してくれる、Markdownという記法を使うことができます。 以下にKobitoで使えるMarkdown記法について説明します。

テキストの装飾

見出し - Headers

これはH1タグです

これはH2タグです

@wreulicke
wreulicke / .zshrc
Last active September 10, 2016 01:23
memo
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=10000
SAVEHIST=10000
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/user/.zshrc'
bindkey -e
#################################################
# オプション
#################################################
# 現在のウィンドウに対して可視ベルの設定します。
vbell off
# ハングアップしたときにscreenは自動的にデタッチ
autodetach on
# 起動時に著作権表示
startup_message off
# スクロールバックバッファの大きさ
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@wreulicke
wreulicke / javascript.json
Last active September 18, 2016 12:38
VSCode snippets
{
"tag snippet": {
"prefix": "tag",
"body": [
"<$1>",
"$2",
"</$1>"
],
"description": "tag snippets"
},
@wreulicke
wreulicke / ActionSerializer.js
Last active September 19, 2016 03:55
ActionSerializer
const isArray=Array.isArray;
function Factory(store){
return ActionSerializer.bind(null, store);
}
function ActionSerializer(store, actions, mutations){
return Object.keys(actions).reduce(function(result, key){
const events=actions[key];
if(isArray(events)){
result[key]=function(...args){