Skip to content

Instantly share code, notes, and snippets.

View alea12's full-sized avatar
🏠

alea12 alea12

🏠
View GitHub Profile
@alea12
alea12 / nokogiri_ajax.rb
Created December 12, 2013 03:27
nokogiri で ajax 使われてるサイトをパースしたい場合、どうしたら良いんだろう
require 'nokogiri'
require 'open-uri'
require 'pp'
html = open('')
sleep 10
doc = Nokogiri::HTML(html)
@alea12
alea12 / tv_scraping_1.rb
Last active December 31, 2015 02:58
テレビ王国 (tv.so-net.ne.jp) のテレビ番組表から、番組詳細情報を取得する
require 'open-uri'
require 'nokogiri'
# date
date = '20131213'
# open tv.so-net.ne.jp and parse it by Nokogiri
target = 'http://tv.so-net.ne.jp/chart/23.action?head=' + date + '0000&span=24'
doc = Nokogiri::HTML(open(target))
@alea12
alea12 / .vimrc
Last active February 13, 2016 08:38
if has('vim_starting')
set nocompatible
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif
if !has('gui_running')
set t_Co=256
endif
call neobundle#begin(expand('~/.vim/bundle'))
@alea12
alea12 / tumblr.css
Last active January 4, 2016 13:59
Tumblr (http://www.tumblr.com/dashboard) dashboard custom css for ROMs
#right_column,
#new_post,
.selection_nipple,
#sidebar_footer_nav {
display: none;
}
#left_column {
float: none;
}
@alea12
alea12 / chatwork.css
Created February 18, 2014 08:58
My Chatwork CSS
.avatarMedium, .avatarTiny {
display: none;
}
.chatTimeLineMessageHover {
background: inherit;
}
.chatTimeLineMessageMention {
background: #ddd;
@alea12
alea12 / commit-msg
Last active August 29, 2015 13:57
hooks
#!/bin/sh
# Check whether commit message includes issue ID
exp="(?:close|closed|closes|fix|fixed|fixes|addresses|references|refs|re|see)"
exp=$exp".?(#[0-9]+(?:(?:[, &]+| *and *)#[0-9]+)*)"
grep -E "$exp" $1 > /dev/null
if [ $? -ne 0 ]; then
echo '*** ERROR ***'
echo 'You need to specify an issue ID to commit.'

Surface Pro 3 の調子が悪くなったので出荷状態に戻していろいろやった。

バックアップから再インストールまで

  • バックアップしたのは将棋関連、ウイイレのセーブデータ、VirtualBox の VM
    • VirtualBox の VM は仮想アプライアンス機能を使ってバックアップした
  • 設定→PC 設定の変更→保守と管理→回復→全てを削除して Windows を再インストールする
    • 再インストールすると初回起動時に Windows Update がかかる。朝開始して会社から帰宅したら終わってた
  • 自宅サーバーの Samba に再接続してバックアップファイルをとりもどす

無いと話にならないものからインストールしていく

@alea12
alea12 / comparison.md
Last active December 11, 2015 05:36
Comparison between Surface Pro 3, VAIO S11 and MacBook Air 11"
Name Surface Pro 3 VAIO S11 MacBook Air 11" Early 2015
Comment 今のメイン。 ほしい。買うなら以下の構成。 比較対象。買うなら以下の構成。
Display 12" wide Touch-Panel 11.6" wide Anti-Glare 11.6" wide Glare
Resolution [px] 2160 x 1440 1920 x 1080 1366 x 768
Size [mm] 295 x 217 x 13.9(*) 284 x 190 x 19.1 300 x 192 x 17
Weight [g] 1095(*) 940 1080
Battery Life [h] 9 14 9
CPU Core i3 4020Y (1.5GHz) Core i5 6200U (2.3~2.8GHz) Core i5 4260U (1.6~2.7GHz)
MMR 4GB 8GB 8GB
@alea12
alea12 / stream.rb
Last active December 27, 2015 04:07
stream.rb
require 'twitter'
class HTTP::URI
def port
443 if self.https?
end
end
CONSUMER_KEY = ''
CONSUMER_SECRET = ''
@alea12
alea12 / twitter_to_bq.rb
Last active December 27, 2015 05:19
twitter_to_bq.rb
require 'google/api_client'
require 'twitter'
require 'pp'
class BigQuery
APP_NAME = 'https://twitter.com/9m'
TABLE_ID = 'timeline'
SCHEMA_FIELDS = [
{
name: 'status_id',