Skip to content

Instantly share code, notes, and snippets.

@g5codyswartz
g5codyswartz / Selenium Cheat Sheet.md
Last active September 3, 2021 21:33 — forked from kenrett/Selenium Cheat Sheet.md
Selenium Cheat Sheet with Table of Contents and Header Fixes - Ruby
// https://gist.github.com/g5codyswartz/3a39448d5919588fb5627ca0344fd4da
var authors = {};
var author;
$(".author_cell").each(function(i,e) {
author = $(e).text().trim();
if (!authors.hasOwnProperty(author)) authors[author] = 0;
authors[author]++
});
===== Custom
{{
---
onot
placehold
lorem
Reputation Manger Login
istock
,
https://reputation.g5search.com/
@g5codyswartz
g5codyswartz / name_me_a_widget.rb
Last active December 31, 2015 08:30 — forked from Sillson/name_me_a_widget.rb
Output an array of widget names & locations
class OrphanAnnie
def self.perform
lost_souls = mom_is_that_you
write_to_loggers("#{lost_souls}")
end
def self.mom_is_that_you
names = Widget.orphans.select {|i| !i.parent_widget.nil?}
web_pages = names.map {|w|
self.get_infos(w)
@g5codyswartz
g5codyswartz / Filter Locations.js
Last active September 28, 2015 22:06
Filters out a list of locations, great for phased builds and large clients. It also calls the location sorter after filtering out.
// MR Phase 1 Locations
var showLocations = [
"Broadmoor Ridge Apartment Homes",
"Candlelight Square",
"Cherry Creek Apartments",
"Cherry Lane Apartment Homes",
"Hampton Park Apartment Homes",
"Indigo Park",
"Lakeside Casitas Apartment Homes",
"Lamplight Square at The Park",
@g5codyswartz
g5codyswartz / get-down-with-down-arrows.js
Last active August 29, 2015 14:25 — forked from Sillson/get-down-with-down-arrows.js
Gettin down with down-arrows
/* Fixes overlap issues */
.row .down-arrow {z-index:0;}
.row .down-arrow.home-arrow {z-index:100;}
</style><script>function insertAfter(referenceNode, newNode) {
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
console.log(referenceNode.parentNode);
}
var div = document.getElementsByClassName("row-grid");
@g5codyswartz
g5codyswartz / AddLocationInputLengthChecker.js
Created May 29, 2015 17:54
Add Location Input Length Checker
var longInputTextLengths = 0;
var inputTextFields = $('input[type=text]');
var inputTextFieldsCount = inputTextFields.length;
$(inputTextFields).each(function() {
if($(this).val().length > 155) {
console.log(this);
console.log('^ Above element character length: '+$(this).val().length);
longInputTextLengths++;
}
@g5codyswartz
g5codyswartz / AutoPlaceholder.js
Last active September 28, 2015 22:07
Auto Placeholder for Liquid Variables
// v1.3.2
// Author: Cody Swartz
// Check for stragglers like G+ input that has no place holder yet
// Then inject the place holder to bandaide it so we can handle it
// Also patch any that have incorrect placeholders
$("input[type=text][id^=widget_settings_attributes]").each(function() {
$(this).attr('placeholder', getCorrectPlaceholder(this));
});