#Getting Started
##Webpage:
<html>
<head>
<title>Testing with Ruby and Selenium WebDriver</title>
</head>
<body bgcolor="antiquewhite">
def repair_drop_targets(html_id, widgets=[]) | |
bad = Website.all.select do |web| | |
!web.website_template.blank? && ( | |
web.website_template.drop_targets.find_by_html_id(html_id).blank? || | |
web.website_template.drop_targets.find_by_html_id(html_id).widgets.blank?) | |
end | |
bad.each do |web| | |
wt = web.website_template | |
dt = wt.drop_targets.find_by_html_id(html_id) |
## G5 Content Management System | |
def find_setting_value(target) | |
Setting.where(Setting.arel_table[:value].matches("%#{target}%")) | |
end | |
def find_setting_value_widgets(target) | |
find_setting_value(target).map do |setting| | |
setting.owner | |
end.uniq |
## Boot chumps from your heroku free dynos | |
## PS the app | |
heroku ps -a [APP] | |
## Find that one-off process, snag that pid | |
=== run: one-off processes (1) | |
run.4570 (Free): up 2016/03/03 10:01:16 -0800 (~ 8m ago): bin/rails console | |
## Tossed like a chump |
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) |
class OrphanAnnie | |
class << self | |
def perform | |
fake_orphan_locations = mom_is_that_you | |
write_to_loggers("#{fake_orphan_locations}") | |
rehome_fake_orphans | |
write_to_loggers("There are #{Widget.orphans.count} orphans left.") | |
Resque.enqueue(WidgetCleanupJob) | |
end |
</style><script>function insertAfter(referenceNode, newNode) { | |
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling); | |
console.log(referenceNode.parentNode); | |
} | |
var div = document.getElementsByClassName("row-grid"); | |
var locationName = "[ENTER LOCATION NAME]"; | |
var locationCity = "[ENTER LOCATION CITY]"; | |
var locationState = "[ENTER LOCATION STATE]"; |
/*! | |
* gulp | |
* $ npm install gulp gulp-rename gulp-replace gulp-browserify gulp-less gulp-csso gulp-uglify gulp-jshint gulp-coffeelint gulp-notify gulp-livereload gulp-sourcemaps gulp-concat coffeeify del jshint-stylish --save-dev | |
*/ | |
var gulp = require('gulp'); | |
var rename = require('gulp-rename'); | |
var replace = require('gulp-replace'); | |
var browserify = require('gulp-browserify'); | |
var less = require('gulp-less'); |
/** | |
* Retrieves all the rows in the active spreadsheet that contain data and logs the | |
* values for each row. | |
* For more information on using the Spreadsheet API, see | |
* https://developers.google.com/apps-script/service_spreadsheet | |
*/ | |
function readRows() { | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
var rows = sheet.getDataRange(); | |
var numRows = rows.getNumRows(); |
function copyToClipboard( text ){ | |
var copyDiv = document.createElement('div'); | |
copyDiv.contentEditable = true; | |
document.body.appendChild(copyDiv); | |
copyDiv.innerHTML = text; | |
copyDiv.unselectable = "off"; | |
copyDiv.focus(); | |
document.execCommand('SelectAll'); | |
document.execCommand("Copy", false, null); | |
document.body.removeChild(copyDiv); |
#Getting Started
##Webpage:
<html>
<head>
<title>Testing with Ruby and Selenium WebDriver</title>
</head>
<body bgcolor="antiquewhite">