Skip to content

Instantly share code, notes, and snippets.

View AhmedKamal20's full-sized avatar
🐧
Linuxing

Ahmed Kamal AhmedKamal20

🐧
Linuxing
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')
@jraines
jraines / rails31init.md
Created May 24, 2011 17:03
Rails 3.1 with Rspec, Cucumber, Factory Girl, Haml, and Simple Form

Install Rails 3.1 RC

gem install rails --pre

generate new app, skipping Test::Unit file generation

rails new my_app -T

Set up Gemfile

@afa
afa / gist:1451070
Created December 9, 2011 10:48
cucmber cheatsheet
#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')
@rstacruz
rstacruz / index.md
Last active November 3, 2023 09:56
Rails models cheatsheet

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one

Features and Step Definitions

Gherkin Keywords

  • Feature
  • Background
  • Scenario
  • Given
  • When
  • Then
  • And
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 7, 2024 01:27
A badass list of frontend development resources I collected over time.
@jonlabelle
jonlabelle / strip_tag_attribs.md
Last active October 30, 2022 15:08
This Regular Expression removes all attributes and values from an HTML tag, preserving the tag itself and textual content (if found).

Strip HTML Attributes

<([a-z][a-z0-9]*)[^>]*?(/?)>
token explanation
< match < at beginning of tags
( start capture group $1 - tag name
[a-z] match a through z
require 'nokogiri'
require 'open-uri'
# Get a Nokogiri::HTML:Document for the page we're interested in...
doc = Nokogiri::HTML(open('http://www.google.com/search?q=tenderlove'))
# Do funky things with it using Nokogiri::XML::Node methods...
####
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active May 14, 2024 04:49
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@elisemoe
elisemoe / notes.md
Last active July 17, 2021 00:27
Cucumber Step Definition - Useful Code and Comments

//scroll to the bottom of the page

((JavascriptExecutor) driver).executeScript("window.scrollTo(0, document.body.scrollHeight)");

Note: Do not upgrade Firefox browser version later than 40 - not compatible with latest Selenium Firefox Driver

Regex for a booking number: ^Ocean #BK+[0-9]{8}