Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Rebert cvrebert

View GitHub Profile
View gist:4b321000df6c9772a014
### package.json
{
"devDependencies": {
"grunt": "^0.4.5",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-less": "^1.0.0",
"load-grunt-tasks": "^3.1.0"
}
}
@cvrebert
cvrebert / css_regression_testing.md
Last active Jan 8, 2021
Survey of screenshot-based CSS testing tools
View css_regression_testing.md

Currently considering https://github.com/webdriverio/webdrivercss


Core Goals:

  • Can test in up-to-date versions of all major browsers
  • Can test on up-to-date versions of all major OSes
  • Can test in IE9 (because Bootstrap v4 will support IE9+)
  • Don't want to have to setup/maintain our own cluster of VMs running all the necessary OSes (and all the versions of Windows)
  • Workflow for management of reference/baseline/norm screenshots
@cvrebert
cvrebert / survey.md
Last active Jan 19, 2021
Click and focus behavior across browsers & OSes
View survey.md

Test apparatus: http://jsfiddle.net/hRub4/

(Windows = Windows 8.1 desktop)

  • Windows Chrome 39
    • Button focuses on click and via keyboard tabbing
    • Anchor focuses on click and via keyboard tabbing
  • Windows Firefox 30.0
    • Button focuses on click and via keyboard tabbing
    • Anchor focuses on click and via keyboard tabbing
  • Windows Internet Explorer 11
@cvrebert
cvrebert / auto_twitchplayspokemon.js
Created Feb 17, 2014
Automatic participant for TwitchPlaysPokemon
View auto_twitchplayspokemon.js
// This is super-hacky since it's 2am.
function press(button) {
$("#chat_text_input").val(button);
$('#chat_speak').click();
}
var silence = false;
var xPos = 0;
var yPos = 0;
var aaa = 0;
View test.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="../../assets/ico/favicon.ico">
@cvrebert
cvrebert / pokecrack.py
Created Jan 19, 2012
So, I took CSE 127...
View pokecrack.py
#!/usr/bin/env python
# Background: http://cses.ucsd.edu/pokemon/ & http://cseweb.ucsd.edu/classes/fa11/cse127-a/
from urllib import urlopen, urlencode
url = "http://cses.ucsd.edu/pokemon/submitemail.php"
for n in range(1, 1000):
data = urlencode({"email":"YourUsernameHere@ucsd.edu", "pokemonid":str(n), "submit":"Catch!"})
f = urlopen(url, data)
result = f.read()
f.close()
print(result) # if you want
@cvrebert
cvrebert / balls_in_numbered_boxes_CVR.py
Created Sep 11, 2011
Refactored "recursive algorithm for balls in numbered boxes"
View balls_in_numbered_boxes_CVR.py
def balls_in_numbered_boxes(balls, box_sizes):
if not isinstance(balls, int):
raise TypeError("balls must be a non-negative integer.")
if balls < 0:
raise ValueError("balls must be a non-negative integer.")
box_sizes = list(box_sizes)
if not box_sizes:
raise ValueError("box_sizes must be a non-empty iterable.")