Skip to content

Instantly share code, notes, and snippets.

@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@syoichi
syoichi / reblogable.user.js
Created January 13, 2012 22:53
Add shortcut key T for Reblog on Tumblr Dashboard.
// ==UserScript==
// @id Reblogable
// @name Reblogable
// @namespace http://syoichi.tumblr.com/
// @version 0.0.5
// @description Add shortcut key T for Reblog on Tumblr Dashboard.
// @include http://www.tumblr.com/dashboard*
// @include http://www.tumblr.com/show/*
// @include http://www.tumblr.com/likes*
// @include http://www.tumblr.com/liked/by/*
@nurse
nurse / gist:4324519
Last active February 28, 2018 11:53
ぼくの考えた最強のRuby新機能案

ぼくの考えた最強のRuby新機能案

野心的な新機能案や、互換性等の理由でおよそ採用されないであろう夢を書き連ねています。

Remove Fixnum and Bignum

Fixnum と Bignum を削除して、Integer クラスに統合する。両者は Flonum のように内部的に切り替えられる。

1 / 2 is Rational

Integer#/ の結果を Rational で返すようにする。 https://bugs.ruby-lang.org/issues/5512#change-37021

@okapies
okapies / promises-are-functional.md
Last active August 14, 2023 11:44
翻訳: ”命令型のコールバック、関数型のプロミス: Node が逸した最大の機会” by James Coglan

命令型のコールバック、関数型のプロミス: Node が逸した最大の機会

Original: "Callbacks are imperative, promises are functional: Node's biggest missed opportunity" by James Coglan

Translated by Yuta Okamoto (@okapies)

Note

  • 訳者は JavaScript や Node.js に関する専門知識がほとんどありません。識者のツッコミをお待ちしております。「◯◯が分からない」等も歓迎です。
  • 元記事から構成を一部変更しています。また、関数型プログラミングに関する記述のうち、議論の骨子に絡まないものは省略しています。
#検証したいUserクラス
class User < ActiveRecord::Base
belongs_to :room
def wait(room)
room.wait
self.room = room
end
end
@atty303
atty303 / gist:7261749
Last active December 27, 2015 03:48
iTerm2 + AquaSKK

iTerm2 + AquaSKK

AquaSKK を素の iTerm2 で使うと、IM 状態を変更するための "C-j" や "l" がそのまま入力されてしまって不便という問題があり、 以下のあたりでその問題を直すパッチを作ってくださった方がおりました。

僕も 1.0.0 が出たころに上記パッチを当てた iTerm2 をずっと使ってました。

@yattom
yattom / problem.md
Last active September 24, 2019 02:06

TDDBC課題:整数の区間

課題1 整数の閉区間 (closed range)

【例】

[3,8]
-> 下端点 (lower endpoint) が3, 上端点 (upper endpoint) が8 である整数閉区間
-> 3 と 8 は区間に含まれます
@bobbygrace
bobbygrace / trello-css-guide.md
Last active May 15, 2024 16:01
Trello CSS Guide

Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets


Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

@onk
onk / .rubocop.yml
Last active January 15, 2018 02:30
僕の使っている .rubocop.yml
# rubocop v0.35.0 から inherit_gem という機能が増えたので gem にしました
# https://github.com/onk/onkcop
inherit_gem:
onkcop: "config/rubocop.yml"
gulp = require 'gulp'
util = require 'gulp-util'
coffee = require 'gulp-coffee'
sass = require 'gulp-sass'
slim = require 'gulp-slim'
plumber = require 'gulp-plumber'
COFFEE_FILES = './src/coffee/**/*.coffee'
gulp.task 'coffee', ->