Skip to content

Instantly share code, notes, and snippets.

@tatsuosakurai
tatsuosakurai / first_step_rspec.md
Last active June 4, 2019 04:16
RSpec 始めの一歩

RSpec を使ってみよう ver.20190319

  • ペアでやってる方は、随時、気になってること、気づいたことをお話してください:)
  • $ はコマンドラインでの実行を表現しているだけなので、打たなくでOKです:)
  • rspec https://github.com/rspec/

1歩目

rspec-bird ディレクトリ作成してみる

$ mkdir rspec-bird
@tatsuosakurai
tatsuosakurai / birthday_test.rb
Last active May 16, 2019 09:47
誕生日の前後一週間かどうかを判定したい!
# 準備
# `gem i activesupport`
# `gem i rspec`
# 実行
# `rspec birthday_test.rb`
# 実装
require 'active_support'
require 'active_support/core_ext'
# require 'byebug'
@tatsuosakurai
tatsuosakurai / birthday_around_a_week_challenge.rb
Created May 15, 2019 11:24
ruby( ActiveSupportあり )で、誕生日の前後一週間かどうかを判定するメソッドを実装してください〜
# 準備
# `gem i activesupport`
# `gem i rspec`
# 実行
# `rspec birthday_around_a_week_challenge.rb`
# 実装
require 'active_support'
require 'active_support/core_ext'
# require 'byebug'
https://github.com/discourse/discourse
https://github.com/feedbin/feedbin
https://github.com/gitlabhq/gitlabhq
https://github.com/coderwall/coderwall-next
https://github.com/codecation/trailmix
https://github.com/thepracticaldev/dev.to
https://github.com/spree/spree
https://github.com/redmine/redmine
@tatsuosakurai
tatsuosakurai / railsguidesj2e
Created April 18, 2018 06:16
railsguides.jp → guides.rubyonrails.org
javascript:var d=document,u=d.URL,en="http://guides.rubyonrails.org",jp="https://railsguides.jp";d.location.href=u.replace(jp,en);
@tatsuosakurai
tatsuosakurai / railsguidesjp2guidesrororg
Last active July 8, 2017 08:04
Rails guide の日本語ページから英語ページに遷移するブックマークレット
javascript:var d=document,u=d.URL,en="http://guides.rubyonrails.org",jp="https://railsguides.jp";d.location.href=u.replace(jp,en);
@tatsuosakurai
tatsuosakurai / recipe_of_curry.html
Last active December 20, 2015 14:29 — forked from machida/html_practice.html
カレーのレシピ
<!doctype html>
<html lang='ja'>
<head>
<title>カレーのレシピ</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
</head>
<body>
<article>
<header>
<h1>カレーのレシピ</h1>
@tatsuosakurai
tatsuosakurai / gist:5038338
Last active December 14, 2015 05:49
tkbjs 2013-02-26 6.9 プロトタイプによる継承
var parent = {
name: "Papa"
};
var child = object(parent);
alert(child.name);
function object(o) {
function F() {}
F.prototype = o;
[
{ "keys": ["ctrl+shift+j"], "command": "js_run" },
{ "keys": ["super+ctrl+shift+`"], "command": "toggle_side_bar" },
{ "keys": ["ctrl+super+`"], "command": "focus_side_bar" },
{ "keys": ["ctrl+shift+t"], "command": "delete_trailing_spaces" },
{ "keys": ["super+alt+["], "command": "reindent" },
{ "keys": ["ctrl+shift+."], "command": "erb" },
{ "keys": ["super+ctrl+m"], "command": "list_rails_models" },
@tatsuosakurai
tatsuosakurai / app.js
Created October 8, 2012 06:23
Emberjs Sample
console.log('hi');
window.Todos = Ember.Application.create();
Todos.Todo = Ember.Object.extend({
title: null,
isDone: false
});
Todos.todosController = Ember.ArrayController.create({
content:[],