Skip to content

Instantly share code, notes, and snippets.

View ursm's full-sized avatar

Keita Urashima ursm

View GitHub Profile
@wjbuys
wjbuys / spec_helper.rb
Created November 4, 2010 20:41
Get the latest versions of RSpec2 and RR to play nice
require 'rspec'
require 'rr'
module RR
module Adapters
module Rspec
def self.included(mod)
RSpec.configuration.backtrace_clean_patterns.push(RR::Errors::BACKTRACE_IDENTIFIER)
end
end
@sunaot
sunaot / gist:613106
Last active April 28, 2020 00:30
バグを生まないプログラミングのために

話しをしたいポイントは3つ。

  • 条件分岐を避けましょう
  • 一時変数の使い方に注意しましょう
  • 状態の使い方に気を使いましょう

これを徹底することで、バグの入り込む余地を最小限に保つプログラミングをしましょう。

条件分岐を避けましょう

require 'rubygems'
require 'rack'
run(lambda do
system 'killall X'
[200, { 'Content-Type' => 'text/plain' }, ['Goodbye!']]
end)
gem 'rails3-generators'
gem 'mongoid', '>= 2.0.0.beta'
gem 'bson_ext'
gem 'haml'
gem 'hirb', :group => :development
gem 'what_methods', :group => :development
gem 'rspec-rails', '>= 2.0.0.beta', :group => :test
gem 'rr', :group => :test
/*!
* jQuery TextChange Plugin
* http://www.zurb.com/playground/jquery-text-change-custom-event
*
* Copyright 2010, ZURB
* Released under the MIT License
*/
(function ($) {
$.event.special.textchange = {
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="2"
inherit elisp-common eutils mercurial toolchain-funcs
DESCRIPTION="The Go Programming Language"
HOMEPAGE="http://golang.org/"
SRC_URI=""