Skip to content

Instantly share code, notes, and snippets.

@deeeki
deeeki / digg_reader_open_in_background_tab.js
Created October 19, 2014 15:59
Digg Reader open in background tab
// ==UserScript==
// @name Digg Reader open in background tab
// @namespace http://deeeki.com/
// @include https://digg.com/reader/*
// @version 0.1.0
// @description A port of "LDR open in background tab" for Digg Reader
// ==/UserScript==
(function(window, load) {
if (this.chrome && !load) {
@deeeki
deeeki / geeaki_ust_agenda.md
Last active August 29, 2015 13:55
Geeaki Ust Agenda
@deeeki
deeeki / ふたり開発KPT.md
Last active December 25, 2015 13:09
ふたり開発KPT

Keep

  • Bitbucket(Gitホスティング)
  • Pull-Requestフロー
  • 複数人コードレビュー
  • 可能な範囲でContributorsに周りを巻き込む

Probrem

  • 進捗遅れ
@deeeki
deeeki / deploy.rb
Created October 2, 2012 13:33
Capistrano Apache deployment recipe
#for RHEL distributions
namespace :httpd do
namespace :deploy do
set :local_src_path, "#{Dir.pwd}/config/httpd/conf.d"
set :remote_src_path, "#{shared_path}/httpd/conf.d"
set :remote_dest_path, '/etc/httpd/conf.d'
task :default, :roles => :web do
transaction do
on_rollback do
@deeeki
deeeki / memo.md
Created July 22, 2012 13:51
RailsにおけるRESTfulなURL設計勉強会
  • legacy wild controller route ':controller(/:action(/:id))(.:format)' は使わない派

  • 利用するURLを明示しておきたい

  • named_route使えないとリンクの記述が冗長になるのでは

  • namespaceなど少し複雑なことをやろうとすると何かしらルーティングを書くことになり、統一感がなくなる

  • 確認画面

    • confirmアクションの追加
      • 各アクションがすっきりする
      • 新規と編集で挙動が変わる場合 (edit_confirmアクション?)
  • パラメータ(mode=confirm)またはモデルの確認用プロパティ(http://bit.ly/mRQ8I5)

@deeeki
deeeki / tokyosharehouse_emptyrooms.rb
Created March 10, 2012 05:59
tokyosharehouse_emptyrooms
# coding: utf-8
require 'mechanize'
SITE_URL = 'http://tokyosharehouse.com'
AREA_URL = "#{SITE_URL}/jpn/houses/area"
a = Mechanize.new
rows = [%w(name area status price line access cond comment url).join(',')]
catch(:break) do
a.get(AREA_URL)
@deeeki
deeeki / hituji.rb
Created March 9, 2012 18:57
hituji_tokyo_emptyrooms
require 'mechanize'
SITE_URL = 'http://www.hituji.jp'
INFO_URL = "#{SITE_URL}/comret/info"
a = Mechanize.new
links = a.get(INFO_URL).search('.searchAreaElement').at('td').search('a').map do |city|
city['href']
end
@deeeki
deeeki / output.sh
Created December 14, 2011 07:04
rails_best_practices (1.6.0) error
/Users/deeeki/dev/src/myapp/vendor/bundle/ruby/1.9.1/gems/rails_best_practices-1.6.0/lib/rails_best_practices/core/routes.rb:27:in `controller_name_with_namespaces': undefined method `camelize' for nil:NilClass (NoMethodError)
from /Users/deeeki/dev/src/myapp/vendor/bundle/ruby/1.9.1/gems/rails_best_practices-1.6.0/lib/rails_best_practices/reviews/remove_unused_methods_in_controllers_review.rb:82:in `block in after_review'
from /Users/deeeki/dev/src/myapp/vendor/bundle/ruby/1.9.1/gems/rails_best_practices-1.6.0/lib/rails_best_practices/reviews/remove_unused_methods_in_controllers_review.rb:80:in `each'
from /Users/deeeki/dev/src/myapp/vendor/bundle/ruby/1.9.1/gems/rails_best_practices-1.6.0/lib/rails_best_practices/reviews/remove_unused_methods_in_controllers_review.rb:80:in `after_review'
from /Users/deeeki/dev/src/myapp/vendor/bundle/ruby/1.9.1/gems/rails_best_practices-1.6.0/lib/rails_best_practices/core/check.rb:224:in `block (2 levels) in included'
from /Users/deeeki/dev/src/myapp/vendor/bundle/ruby
@deeeki
deeeki / wp_static_method_hook.php
Created December 11, 2011 08:23
クラスメソッドでフック
class wp_atnd_widget extends WP_Widget {
//クラスメソッド
static public function register() {
register_widget('wp_atnd_widget');
}
//...
}
//クラスメソッドでフック
add_action('widgets_init', array('wp_atnd_widget', 'register'));