Skip to content

Instantly share code, notes, and snippets.

View jessehouchins's full-sized avatar
🛋️
Working from couch

Jesse Houchins jessehouchins

🛋️
Working from couch
View GitHub Profile
@mixin my-component {
all: initial;
* { all: unset; }
}
@mixin my-box {
@include my-component;
display: inline-block;
background: white;
border: 1px solid black;
<html>
<body>
<swatch color="black">
<color darken="66"></color>
<color darken="44"></color>
<color darken="22"></color>
<color></color>
<color lighten="18"></color>
<color lighten="36"></color>
<color lighten="54"></color>
@jessehouchins
jessehouchins / SassMeister-input-HTML.html
Created April 13, 2015 17:18
Generated by SassMeister.com.
<html>
<body>
<dark class="d27">Darken (-27%)</dark>
<color>Base Color</color>
<light class="l97">Lighten (97%)</light>
</body>
</html>
@jessehouchins
jessehouchins / null-false-value.js
Created February 28, 2015 23:44
Null ng-false-value
;(function(){
'use strict'
// Sets falsy values as null on the model. This does not seem to be possible
// using ng-false-value, since it sets it as "null" (string) instead.
// usage <input type="checkbox" ng-model"model.attr" null-false-value />
angular.module('yourModule')
.directive('nullFalseValue', function(_){
@jessehouchins
jessehouchins / ngModelCreate
Created November 25, 2014 15:03
An Angular directive that converts ngModel attributes to dot notation so nested properties will bind correctly, even if they did not previously exist.
// convert `ng-model="foo[bar.key][baz.key]"` to `ng-model="foo.barKey.bazKey"`
// which will allow the ng-model directive to auto-generate the nested structure.
.directive('ngModelCreate', function(_){
function makeDotPath(scope, expr) {
var pathParts = _.compact(expr.split(/\[|\]/g))
var convertedParts = _.map(pathParts, function(part, i) {
if (i === 0) return part
if (part[0] === '.') return part.substr(1)
return scope.$eval(part)

#Time Analysis of Running Selenium Tests in Parallel

##Introduction Having recently joined Sport Ngin as an Automation Engineer, I needed to choose a strategy to execute an Automation Regression Suite. With the vastness that is our web application, we need to be able to perform Automated Regression Tests in a way that avoids disrupting development workflow without sacrificing the value it provides. Thankfully there are tools that aim to balance usefulness and unobtrusiveness. I'm going to talk specifically about tools based around Selenium WebDriver. Selenium Grid 2 easily allows for testing multiple browsers on multiple computers. There's BrowserStack and Sauce Labs which are SaaS services that run on top of Selenium Grid 2 utilizing Amazon's AWS EC2 instances. There are also other tools that help create distributive systems, such as Jenkins. I've created a handful of Automation Frameworks in the past and have run them on a local server farm as well as in Sauce Labs and in BrowserStack. Comparing

@jessehouchins
jessehouchins / gist:0b2415b5673cc1c71fff
Created August 5, 2014 02:49
Angular Double Click (that prevents single click)
.directive('doubleClick', function($timeout, _) {
var CLICK_DELAY = 300
var $ = angular.element
var omitProperties = 'isDefaultPrevented isImmediatePropagationStopped isPropagationStopped'.split(' ')
return {
restrict: 'A',
link: function(scope, element, attrs) {
var clickCount = 0
@jessehouchins
jessehouchins / translateEventTo
Last active August 29, 2015 13:55
Convenience wrapper for translating delegated events to directly bound events in Backbone views. This was developed specifically for converting delegated `mouseover` events to bound `scroll` events, but could be used in other cases as well.
var $ = require('jquery')
// This helper allows you to translate events that DO bubble
// to directly bound events for event typess that DO NOT
// (like scroll) using either syntax below:
// var translateEventTo = require('translateEventTo')
// ...then in the view class definition...