Skip to content

Instantly share code, notes, and snippets.

View takegue's full-sized avatar
🏠
Working from home

takegue takegue

🏠
Working from home
View GitHub Profile
@takegue
takegue / 0post.md
Last active November 6, 2022 12:18
SQLのためのテンプレートエンジン再考

テンプレートエンジンののコードをコードとして管理したくない

  • テンプレート化されたコードを読み解くコストは高い

    • コードは書くよりも読まれる時間の方が長い
  • テンプレートのコードは lint/formatter/コード補完などの静的解析ツールの相性が悪い

@takegue
takegue / git-sparse-checkout-for-circleci.sh
Last active February 14, 2020 10:54 — forked from sumardi/gist:5559896
Subdirectory checkouts with Git sparse-checkout
#!/bin/bash -e
CIRCLE_WORKING_DIRECTORY="${CIRCLE_WORKING_DIRECTORY/#\~/$HOME}"
[[ ! -d $CIRCLE_WORKING_DIRECTORY ]] && mkdir -p $CIRCLE_WORKING_DIRECTORY
cd $CIRCLE_WORKING_DIRECTORY
git init
git remote add origin $CIRCLE_REPOSITORY_URL
git config core.sparsecheckout true
@takegue
takegue / 2017-05-02-091531.sql
Created May 2, 2017 00:16
Randomly pick up records on SQL
SELECT *
FROM `sitemap_acp_tree_fixed_to_xml`
WHERE `tree` = '1002'
ORDER BY RAND()
LIMIT 50
@takegue
takegue / picaro.py
Last active October 27, 2016 02:28
A Simple command-line alignment visualization tool modified for double-width characters
#!/usr/bin/env python2
# -*- coding:utf-8 -*-
#
# Picaro: An simple command-line alignment visualization tool.
#
# picaro.py
# Visualize alignments between sentences in a grid format.
#
# Jason Riesa <riesa@isi.edu>
# version: 01-16-2010
@takegue
takegue / N行より+10行を表示する
Last active May 12, 2016 18:48
ファイルの途中行を表示する(便利tips集) ref: http://qiita.com/tkngue/items/973279aa34c8c8a7a72a
sed -sn 'N,+10p' *
@takegue
takegue / file0.txt
Last active June 10, 2017 03:20
複数の形態素解析器を見比べる ref: http://qiita.com/tkngue/items/b32ddcaf3ad80bf93d8c
$ cat text.txt | mecab-all
IPADIC :私大 ファン な ん です
JUMAN :私大 ファン な んです
JUMANDIC:私大 ファン な んです
JUMANPP :私大 ファン な んです
KYTEA :私大 ファン な ん で す
NEOLOG :私大 ファン な ん です
SNOW :私大ファン な ん です
UNIDIC :私大 ファン な ん です
@takegue
takegue / zbell.zsh
Last active October 16, 2020 06:40 — forked from oknowton/zbell.zsh
#!/usr/bin/env zsh
# This script prints a bell character when a command finishes
# if it has been running for longer than $zbell_duration seconds.
# If there are programs that you know run long that you don't
# want to bell after, then add them to $zbell_ignore.
#
# This script uses only zsh builtins so its fast, there's no needless
# forking, and its only dependency is zsh and its standard modules
#
@takegue
takegue / dsp.py
Last active January 14, 2021 04:40
Simple DSP Server for AdTech Competition 2016. To run this code, you have to install "tornado" which is a Python Framework.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from tornado import ioloop, httpserver, web, httpclient
import json
import urllib.parse
import logging
import time
@takegue
takegue / 2015-07-31-121816.py
Last active March 14, 2016 21:09
NLP主要会議のGoogle Calendar生成スクリプト(http://www.cs.rochester.edu/~tetreaul/conferences.html)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
NLP 主要会議のGoogle Calendar日程作成用のscript
http://www.cs.rochester.edu/~tetreaul/conferences.html
"""
import pandas as pd
import dateutil as du
@takegue
takegue / 2015-01-25-005613.py
Last active August 29, 2015 14:14
MeCab implementation for Python using subprocess
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import subprocess
import itertools as itt
class MeCab():
def __init__(self, opts=[]):