Skip to content

Instantly share code, notes, and snippets.

View hokuma's full-sized avatar
🎯
Focusing

hokuma hokuma

🎯
Focusing
View GitHub Profile
FROM centos:7
MAINTAINER hokuma
RUN yum install -y http://packages.groonga.org/centos/groonga-release-1.1.0-1.noarch.rpm
RUN yum install -y http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
RUN yum makecache
RUN yum install -y mysql-community-server
RUN yum install -y mysql-community-mroonga
RUN mysql_install_db --datadir=/var/lib/mysql --user=mysql
@hokuma
hokuma / Dockerfile
Created April 28, 2015 02:48
Basic認証対応apache(第3回勉強会課題)
FROM centos:6
MAINTAINER hokuma
RUN yum -y update && yum install -y httpd
ENV USERNAME admin
ENV PASSWORD qwerty
COPY server.conf auth.conf /etc/httpd/conf.d/
@hokuma
hokuma / measure.js
Last active August 29, 2015 14:27
温度を取得してdynamodbに保存する
var fs = require('fs');
var Aws = require('aws-sdk');
var deviceId = 'YOUR_DEVICE_ID';
var sensorPath = '/sys/bus/w1/devices/' + deviceId + '/w1_slave';
var data = fs.readFileSync(sensorPath, {'encoding': 'ascii'});
var temp_line = data.split("\n")[1];
var matches = temp_line.match(/t=(\d+)/);
var temp;
@hokuma
hokuma / tab2space.sh
Created October 2, 2015 08:16
tab2space
#!/bin/sh
scss_files=`find app/assets/stylesheets -name "*.scss"`
for filepath in ${scss_files}
do
sed -i .orig s/$'\t'/' '/g ${filepath}
rm ${filepath}.orig
done
@hokuma
hokuma / browser.js
Last active October 18, 2015 12:35
node環境でsinon.jsのfakeServerを使う ref: http://qiita.com/halhide/items/498f094ac670884e55c9
// ブラウザ環境っぽいものを作る
import jsdom from 'jsdom';
import jQuery from 'jquery';
import { XMLHttpRequest } from 'w3c-xmlhttprequest';
global.XMLHttpRequest = XMLHttpRequest;
global.document = jsdom.jsdom('<!doctype html><html><body></body></html>');
global.window = document.parentWindow;
global.$ = jQuery(window);
@hokuma
hokuma / comment_hotspots.rb
Last active June 7, 2018 05:50
bugspots reviewer
require 'octokit'
# Hotspotの結果は、以下のようになっている
# Scanning . repo
# Found 3010 bugfix commits, with 2029 hotspots:
#
# Fixes:
# - :bug: fix xxx
# - fix yyy bug
# - zzz bug fixed
@hokuma
hokuma / lda.py
Created August 4, 2017 16:14
lda
import sys
import string
import json
from pprint import pprint
from gensim import corpora, models
from collections import defaultdict
def stopword(token):
return string.punctuation.find(token) > -1
@hokuma
hokuma / chromebook-linux-docker.md
Created August 9, 2018 14:28
chromebookで動作するLinuxにdockerを入れる

Linuxの有効化

asusのchromebook を持っているのですが、chromebookでLinuxが動作するCrostini機能が有効になったので使ってみました。

有効にする方法は、この記事を参考にしました。

devチャンネルにし、設定から有効にするだけです。chrome::flagsから設定を有効にするといった記事がありますが、バージョン: 69.0.3497.21(Official Build)dev (32 ビット)においては不要でした。

記事にあるとおり、インストールを開始してしばらくするとエラーが表示されてさも失敗に終わったかのようなメッセージが出ますが、無視してください。

アプリ一覧にTerminalができているはずなので、起動します。ここでアプリ一覧に追加されていなければ本当にインストールに失敗しているかもしれません。

@hokuma
hokuma / screen-capture-movice.md
Created August 11, 2018 14:19
スクリーンキャプチャ動画を取る機会があったので知見をメモ

スクリーンキャプチャ動画を取る方法

macで取るなら、 QuickTimePlayer で収録可能。 https://support.apple.com/ja-jp/guide/quicktime-player/qtp97b08e666/mac

解説などの音声を収録するなら、指向性のマイクを使う。 ヘッドセットの場合は、マイクと口の位置関係に注意。 口に近すぎると音声が割れたり呼吸音が入るが、遠すぎるとそもそも音が小さくなる。

音声を加工する

とはいっても、ちょうど良い具合に収録するのは簡単ではない。

@hokuma
hokuma / AllVotes.ipynb
Created December 30, 2018 05:48
柏議会の投票結果のテーブルhtmlから結果を抽出する
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.