Skip to content

Instantly share code, notes, and snippets.

View yusuke024's full-sized avatar

Yusuke Onishi yusuke024

  • Google
  • Tokyo, Japan
View GitHub Profile
@yusuke024
yusuke024 / TaskQL
Last active September 29, 2016 08:18
protocol Query {
func serialized() -> String
}
protocol Field: Query {
}
protocol Argument {
// ...
#include <iostream>
#include <string>
#include <vector>
std::vector<std::string> comb(std::string s, int n) {
std::vector<std::string> v;
if (s.size() < n || n <= 0) return v;
auto ss = s.substr(0, 1);
auto vv = comb(s.substr(1), n-1);
if (vv.size() == 0) {
import json
import sys
import xml.etree.ElementTree as ET
def main():
# preprocess
kanji_info = {}
# from kanji dict xml file
tree = ET.parse('./res/kanji.xml')
#!/bin/sh
DEST_DIR=./res
if [ ! -d ${DEST_DIR} ]
then
mkdir -p ${DEST_DIR}
fi
if [ ! -f ${DEST_DIR}/kanji.xml ]
package main
import (
"bytes"
"crypto/hmac"
"crypto/sha256"
"encoding/base64"
"encoding/json"
"errors"
"fmt"
#!/bin/sh
SESSION_NAME=redux
tmux has-session -t $SESSION_NAME
if [ $? != 0 ]
then
tmux new-session -s $SESSION_NAME -d
tmux send-keys -t $SESSION_NAME "webpack src/app.js dist/bundle.js -w" C-m
@yusuke024
yusuke024 / -
Created February 22, 2016 13:35
git log --author="sikhapol" --numstat --pretty=tformat: --all | grep -v "Pods" | grep ".*\.[mh]" | cut -f1 | awk '{s+=$1} END {print s}'
package main
import (
"flag"
"io/ioutil"
"log"
"os"
"github.com/RNCryptor/RNCryptor-go"
)
@yusuke024
yusuke024 / json.swift
Last active September 24, 2015 21:39
enum JSON {
case StringType(String)
enum Number {
case IntType(Int)
case FloatType(Float)
}
case NumberType(Number)
case BoolType(Bool)
#!/usr/bin/env swift
while let line = readLine() {
print(line)
}