Skip to content

Instantly share code, notes, and snippets.

View suin's full-sized avatar
😃

suin

😃
View GitHub Profile
@suin
suin / README.md
Last active May 14, 2018 12:32
iTerm2の背景をポケモンにできるツールLazoCoder/Pokemon-Terminalの日本語ローマ字版データです。

iTerm2の背景をポケモンにできるツールLazoCoder/Pokemon-Terminalの日本語ローマ字版データです。英語名のポケモンじゃ分からない人向けです。例えば、イーブイにしたいときpokemon eeveeと打たないといけないところが、このデータをインストールするとpokemon i-buiでできるようになります。

インストール方法

Pokemon-Terminalをインストールした後に次のコマンドを実行して、ポケモン名データを書き換えてください

wget https://gist.githubusercontent.com/suin/7ba1e2b7a1feb5d0c01a6756f736d24d/raw/b210c99b105cf1a4a6854a55cf3d2f95dc981eba/pokemon.txt -O $HOME/.Pokemon-Terminal/Data/pokemon.txt
SELECT articles.title, GROUP_CONCAT(keywords.name) AS keywords FROM articles
LEFT JOIN article_keywords
ON articles.id = article_keywords.article_id
LEFT JOIN keywords
ON keywords.id = article_keywords.keyword_id
GROUP BY articles.id
;
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.2.6)
actionpack (= 4.2.6)
actionview (= 4.2.6)
activejob (= 4.2.6)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.6)
$(function(){
$(".checklist").each(function(){
var checklist = $("<div>");
$(this).children("li").each(function(){
var contents = $(this).html();
var item = $("<label>");
$("<input>").attr("type", "checkbox").appendTo(item);
item.append("&nbsp;");
item.append($(this).html());
$("<div>").append(item).appendTo(checklist);
# ----------------- #
# ウィンドウの振る舞い #
# ----------------- #
# ウィンドウ番号1から開始する
set-option -g base-index 1
# マウスでスクロールできるようにする
set-window-option -g mode-mouse on
# これを有効にすると、MacでCommand+Cなどができなくなるが、
@suin
suin / 貸出業務.scala
Last active December 16, 2015 12:39
Scalaで図書館ドメインモデルを軽く組んでみた。クラス図は「誤解しがちなモデリングの技:第7回:モデルの意味的な誤り(I) | 豆蔵ソフト工学ラボ( http://labo.mamezou.com/special/sp_002/sp_002_007.html)」を参考にした。
import java.util.Date
// entity
class 書誌 (
ISBN:ISBN,
書誌名:String,
出版社:String,
発売日:Date
) {
def ISBN():ISBN = ISBN
@suin
suin / TypeError: c is null.md
Last active December 13, 2015 22:39
Selenium2 + Firefox: Could not take screenshot of current page - TypeError: b.body is null This is a report for issue: https://code.google.com/p/selenium/issues/detail?id=5130

The other type of error is:

21:56:54.665 WARN - Exception thrown
org.openqa.selenium.WebDriverException: Could not take screenshot of current page - TypeError: c is null
Command duration or timeout: 624 milliseconds
Build info: version: '2.30.0', revision: 'dc1ef9c', time: '2013-02-19 00:15:27'
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.8.2', java.version: '1.6.0_37'
Session ID: f4ec9f98-12e9-9d46-87f8-de5a4c6bddbd
Driver info: org.openqa.selenium.firefox.FirefoxDriver
@suin
suin / timezone.php
Last active December 11, 2015 03:38
<?php
namespace Goodby\TimeZone;
use Exception;
use DateTime;
use DateTimeZone;
class ReliableTimeZoneDateTime extends DateTime
{
@suin
suin / accept-language.php
Created December 26, 2012 07:21
AcceptLanguage negotiation algorithm
<?php
/**
* Return accept languages
* @return array
*
* HTTP content negotiation (section 12) uses short "floating point" numbers to indicate the
* relative importance ("weight") of various negotiable parameters. A weight is normalized to
* a real number in the range 0 through 1, where 0 is the minimum and 1 the maximum value.
* If a parameter has a quality value of 0, then content with this parameter is `not acceptable'
* for the client. HTTP/1.1 applications MUST NOT generate more than three digits after the
【K&R】
function(...)
{
}
if (...) {