Skip to content

Instantly share code, notes, and snippets.

View kentaro's full-sized avatar

Kentaro Kuribayashi kentaro

View GitHub Profile
@kentaro
kentaro / private.xml
Created September 9, 2013 07:41
Terminal.appとかiTerm2とかで、C-[で英数モードにする。 ref: http://r7kamura.hatenablog.com/entry/20110217/1297910068
<?xml version="1.0"?>
<root>
<list>
<item>
<name>LeaveInsMode with EISUU(Terminal)</name>
<identifier>private.app_terminal_esc_with_eisuu</identifier>
<only>TERMINAL</only>
<autogen>--KeyToKey-- KeyCode::BRACKET_LEFT, VK_CONTROL, KeyCode::JIS_EISUU, KeyCode::BRACKET_LEFT, VK_CONTROL</autogen>
</item>
</list>
@kentaro
kentaro / gist:6181090
Last active December 20, 2015 19:09
PHPカンファレンス2013へのプロポーザル

Webサービスは、いちどリリースしてしまえばそれで終わりということはありません。むしろ、リリースしてからが勝負です。ユーザからのフィードバック、市場環境の変化などに対応し、常に変化し続ける必要があります。それは避けようのない、Webサービスの宿命です。

先日、PHPのバージョン5.5系がリリースされ、5.3系のEnd of Lifeが発表されました。OSSによる開発は、ソフトウェアへの初期投資という意味においては無料ですが、その運用に関しては度重なるアップデートにきちんと追従していく必要があるという意味では、それなりのコストがかかります。

Webサービス開発においては、先に挙げた外部環境からのフィードバックや変化に加えて、技術環境の変化にも対応していく必要があるということです。

本トークでは、技術環境の変化、その中でもアプリケーションが利用するPHPのバージョンアップをいかに行うかについて、また、ただ一度のみならず継続的に行えるようにするにはどうするかについて、実例を元にその手法を紹介します。

<?php
if ("") {
echo "んなわけねーじゃん";
} else {
echo "空文字はFALSEとして評価される";
}
if ("" == FALSE) {
echo "空文字はFALSEとして評価される";
server = Glint::Server.new do |port|
exec 'memcached', '-p', port.to_s;
exit 0
end
server.start
config.cache_store = :dalli_store, "127.0.0.1:#{server.port}",
{ :namespace => NAME_OF_RAILS_APP, :expires_in => 1.day, :compress => true }
$ cpanm Module::Install::Repository
Module::Install::Repository is up to date. (0.06)
$ cpanm Encode::Base58::BigInt
--> Working on Encode::Base58::BigInt
Fetching http://www.cpan.org/authors/id/S/SA/SATOH/Encode-Base58-BigInt-0.02.tar.gz ... OK
Configuring Encode-Base58-BigInt-0.02 ... N/A
! Configure failed for Encode-Base58-BigInt-0.02. See /Users/kentaro/.cpanm/build.log for details.
$ lv ~/.cpanm/build.log
(defun ag ()
(interactive)
(let ((grep-command "ag -a --nocolor ")
(grep-find-command "ag --nocolor --nogroup "))
(call-interactively 'grep-find)))
@kentaro
kentaro / gist:4975262
Created February 18, 2013 05:22
flatten
#!/usr/bin/env perl
use strict;
use warnings;
use YAML;
sub flatten {
my @list = @_;
map {
my $element = $_;
@kentaro
kentaro / My First FizzBuzz in Haskell
Created January 6, 2013 09:13
FizzBuzz in Haskell
fizzBuzz n = take n [
if (m `mod` 15) == 0 then "FizzBuzz"
else if (m `mod` 3) == 0 then "Fizz"
else if (m `mod` 5) == 0 then "Buzz"
else show m
| m <- [1..] ]
$ ruby -rbundler -e 'Bundler.require; p Gem::Specification.dirs'
/Users/usr0600239/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/bundler-1.2.1/lib/bundler/spec_set.rb:90:in `block in materialize': Could not find rake-0.9.2.2 in any of the sources (Bundler::GemNotFound)
~/dev/github/triglav (2.0.0-dev) (git)-[master]
$ ls /Users/usr0600239/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/specifications
bigdecimal-1.1.0.gemspec method_source-0.8.1.gemspec rspec-2.11.0.gemspec
bundler-1.2.1.gemspec minitest-3.4.0.gemspec rspec-core-2.11.1.gemspec
coderay-1.0.8.gemspec pry-0.9.10.gemspec rspec-expectations-2.11.3.gemspec
diff-lcs-1.1.3.gemspec psych-1.3.4.gemspec rspec-mocks-2.11.3.gemspec
io-console-0.3.gemspec rake-0.9.2.2.gemspec slop-3.3.3.gemspec
json-1.7.1.gemspec rdoc-3.9.4.gemspec test-unit-2.0.0.0.gemspec
$
~/dev/github/triglav (2.0.0-dev) (git)-[master]