Skip to content

Instantly share code, notes, and snippets.

View hideshi's full-sized avatar

Hideshi Ogoshi hideshi

View GitHub Profile
@hideshi
hideshi / file0.txt
Created July 11, 2017 02:20
Vagrantでホストとの時刻同期を止める ref: http://qiita.com/hideshi/items/a75f45e4d714708e46e3
$ date
Tue Jul 11 01:39:04 UTC 2017
$ sudo service vboxadd-service stop
@hideshi
hideshi / file0.txt
Last active December 20, 2015 23:50
[翻訳]Elixirコミュニティ向けの新しいオープンソースツールの紹介 ref: http://qiita.com/hideshi@github/items/d8e23cc8aeed766f0b6e
my_map = HashDict.new
other_map = HashDict.put(my_map, :my_age, 39)
IO.inspect(my_map)
#HashDict<[]> # my_map has not been changed
IO.inspect(other_map)
#HashDict<[my_age: 39]> # other_map has the new values
@hideshi
hideshi / file0.txt
Created December 11, 2015 04:02
Gitで修正したファイルをコミット毎に見たい時のコマンド ref: http://qiita.com/hideshi@github/items/2f2dc8348e53129fa348
git log --pretty=oneline --name-only
@hideshi
hideshi / file1.txt
Created December 2, 2015 00:04
[翻訳]Elixirでコマンドラインアプリケーションを書く ref: http://qiita.com/hideshi@github/items/615e4f859a2486e7ab58
defmodule EightBall.CLI do
def main(args) do
end
end
@hideshi
hideshi / argv.exs
Created December 1, 2015 00:09
コマンドラインツールの作り方 ref: http://qiita.com/hideshi@github/items/b93920901d76a471fcb3
#!/usr/bin/env elixir
System.argv()
|> Enum.each(fn(x) -> IO.puts x end)
#!/usr/local/bin/gawk -f
/<page>/ {
flg=1;
}
/<\/page>/ {
flg=0;
gsub(/^\s+/,"",s);
gsub(/\s+/," ",s);
print s;
table_create Wiki TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto
column_create --table Wiki --name content --type LongText
table_create Term TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto
column_create Term wiki_content COLUMN_INDEX|WITH_POSITION Wiki content
<?php
function convert($number) {
$array1 = array('兆', '億', '万', '千', '百', '十');
$array2 = array('', '一', '二', '三', '四', '五', '六', '七', '八', '九');
$chou = (int)($number / 1000000000000);
$rest = $number % 1000000000000;
$oku = (int)($rest / 100000000);
$rest = $rest % 100000000;
$man = (int)($rest / 10000);
$rest = $rest % 10000;
@hideshi
hideshi / python_in_shell.sh
Created February 1, 2014 16:13
How to use Python in shell script
#!/bin/sh
ls -l | python3.3 -c '
import sys
import re
for i in sys.stdin:
line = re.compile(r"\s+").split(i.strip())
if len(line) == 9:
print(line[8])
@hideshi
hideshi / cgilib.scala
Last active January 4, 2016 08:09
CGI library for Scala
package cgilib
import System._
import scala.io.Source._
import scala.collection.JavaConversions._
object CGI {
val GET = "GET"
val POST = "POST"
def envInfo():Map[String, String] = {getenv().toMap}
def params(method:String):Map[String, String] = {
val in = method match {