Skip to content

Instantly share code, notes, and snippets.

View kyuden's full-sized avatar

Masahiro Kyuden kyuden

View GitHub Profile
@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')
@mattheworiordan
mattheworiordan / focus_test.feature
Created August 23, 2011 22:44
:focus pseudo selector fix for Capybara-webkit and or Selenium with Cucumber
Feature: Capybara Webkit and Selenium :focus test
In order to show that Capybara Webkit and Selenium do not allow an element to maintain focus
I created this feature
Which anyone can try
@selenium
Scenario: Run demo page with Selenium
When I am on the capybara demo page
And I fill in "inpt" with "Test snapshot"
Then I should see a successful result
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@Integralist
Integralist / web-server.rb
Created June 3, 2012 10:16
Create basic Web Server in Ruby (using WEBrick)
#!/usr/bin/env ruby
require "webrick"
=begin
WEBrick is a Ruby library that makes it easy to build an HTTP server with Ruby.
It comes with most installations of Ruby by default (it’s part of the standard library),
so you can usually create a basic web/HTTP server with only several lines of code.
The following code creates a generic WEBrick server on the local machine on port 1234,
@pmeinhardt
pmeinhardt / capybara-cheatsheet.md
Last active December 14, 2015 16:29 — forked from zhengjia/capybara cheat sheet
overview of the capybara dsl

Capybara Cheat Sheet

View the original gist: https://gist.github.com/428105

Navigating

visit "/projects"
visit post_comments_path(post)

Clicking Links and Buttons

@rummelonp
rummelonp / vine.rb
Last active December 16, 2015 18:49
Vine の非公式 API を Ruby から使うやつ (参考: https://github.com/starlock/vino/wiki/API-Reference)
# -*- coding: utf-8 -*-
require 'faraday'
require 'faraday_middleware'
module Vine
def self.login(username = ENV['VINE_USERNAME'], password = ENV['VINE_PASSWORD'])
data = Vine::Client.new.login(username, password)
Vine::Client.new(data['key'])
end
@Gab-km
Gab-km / whyILeftHeroku.rst
Last active December 30, 2022 10:56
何故私は Heroku から離れたか、および新しい AWS セットアップのメモ

何故私は Heroku から離れたか、および新しい AWS セットアップのメモ

原著者:Adrian Holovaty
原文:Why I left Heroku, and notes on my new AWS setup

金曜日、私は Heroku から Amazon Web Services(AWS) を直接使うように Soundslice を移行しました。私はこの変更ができてとても、そうとても嬉しくて、私がどうやったかということと、もし皆さんが同じような立場だったら何故それを検討すべきかということについて広く伝えたいと思います。

@psyked
psyked / gist:5847065
Last active November 13, 2018 15:35
JavaScript Observer Pattern - Module Pattern implementation
var Observable = (function()
{
"use strict";
/**
* @constructor
* @returns {{attach: Function, detach: Function, notify: Function}}
*/
var constructor = function()
{
@SabretWoW
SabretWoW / rspec_model_testing_template.rb
Last active May 28, 2024 17:41
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems:
@yatemmma
yatemmma / git-lesson.md
Last active February 15, 2022 03:36
git初心者への道 - お仕事で困らないレベルまでググっとします。

git初心者への道

まずやってみよう - コミットする、ログを見る、差分を見る

初登場するコマンド: init, add, commit, log, config, status, diff