Skip to content

Instantly share code, notes, and snippets.

View andrewchilds's full-sized avatar
☑️

Andrew Childs andrewchilds

☑️
View GitHub Profile
@andrewchilds
andrewchilds / toSelector.js
Created February 28, 2014 18:22
Simple element-to-CSS-selector conversion
function toSelector(elem) {
var css = '';
if (elem && elem.tagName) {
css += elem.tagName.toLowerCase();
if (elem.id) {
css += '#' + elem.id;
}
if (elem.className) {
css += '.' + elem.className.trim().split(' ').join('.');
}
(function () {
function isSupported() {
try {
return 'localStorage' in window && window['localStorage'] !== null;
} catch(e) {
return false;
}
}
if (!isSupported()) {
@andrewchilds
andrewchilds / .gitconfig
Last active July 12, 2016 20:45
My Git Config
[color]
diff = auto
status = auto
branch = auto
interactive = auto
ui = auto
[alias]
st = status
br = branch