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
protocol Query { | |
func serialized() -> String | |
} | |
protocol Field: Query { | |
} | |
protocol Argument { | |
// ... |
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 <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) { |
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 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') |
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
#!/bin/sh | |
DEST_DIR=./res | |
if [ ! -d ${DEST_DIR} ] | |
then | |
mkdir -p ${DEST_DIR} | |
fi | |
if [ ! -f ${DEST_DIR}/kanji.xml ] |
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
package main | |
import ( | |
"bytes" | |
"crypto/hmac" | |
"crypto/sha256" | |
"encoding/base64" | |
"encoding/json" | |
"errors" | |
"fmt" |
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
#!/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 |
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
git log --author="sikhapol" --numstat --pretty=tformat: --all | grep -v "Pods" | grep ".*\.[mh]" | cut -f1 | awk '{s+=$1} END {print s}' |
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
package main | |
import ( | |
"flag" | |
"io/ioutil" | |
"log" | |
"os" | |
"github.com/RNCryptor/RNCryptor-go" | |
) |
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
enum JSON { | |
case StringType(String) | |
enum Number { | |
case IntType(Int) | |
case FloatType(Float) | |
} | |
case NumberType(Number) | |
case BoolType(Bool) |
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 swift | |
while let line = readLine() { | |
print(line) | |
} |