Skip to content

Instantly share code, notes, and snippets.

View KevinTCoughlin's full-sized avatar

Kevin T. Coughlin KevinTCoughlin

View GitHub Profile
@KevinTCoughlin
KevinTCoughlin / chrome_devtools_console_cheatsheet.md
Last active March 8, 2017 21:49
Chrome DevTools Console Cheatsheet
  • $_ - returns the value of the most recently evaluated expression.
  • $0-4 - Last five DOM elements inspected or last five JS heap objects
  • $(selector) - alias for document.querySelector()
  • $$(selector) - alias for document.querySelectorAll()
  • $x(path) - array of DOM elements that match the XPath expression (e.g "//p[a]")
  • clear() - clear console
  • copy(object) - copy object to clipboard
  • debug(function) - debugger invoked and breaks inside the function
  • dir(object) - object-style listing of all specified objects properties, alias for console.dir()
  • getEventListeners(object) - returns the event listeners on an object
@KevinTCoughlin
KevinTCoughlin / chrome_devtools_console_cheatsheet.md
Created March 8, 2017 19:42
Chrome DevTools Console Cheatsheet

$_ returns the value of the most recently evaluated expression. $0-4 - Last five DOM elements inspected or last five JS heap objects $(selector) alias for document.querySelector() $$(selector) alias for document.querySelectorAll() $x(path) array of DOM elements that match the XPath expression (e.g "//p[a]") clear() copy(object) debug(function) // debugger invoked and breaks inside the function dir(object) object-style listing of all specified objects properties, alias for console.dir() getEventListeners(object)

import _ from 'lodash';
import { $state } from 'ui-router';
function launchHelper(state, params, ctrlKey, options) {
if (ctrlKey) {
const url = $state.href(state, params, _.defaults(options, { absolute: true }));
window.open(url);
} else {
$state.go(state, params, options);
}
@KevinTCoughlin
KevinTCoughlin / README.md
Created September 26, 2016 18:31 — forked from addyosmani/README.md
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");
c = checkout
d = diff
ds = diff --staged
l = log --all --graph --oneline --decorate
s = status --short --branch
g = grep --break --heading --line-number
ff = merge --ff-only
puff = pull --ff-only
purr = pull --rebase
mnc = merge --no-ff --no-commit
module.exports = () => return "Hello World";
@KevinTCoughlin
KevinTCoughlin / settings.json
Created March 3, 2016 20:59
Visual Studio Code Settings
// Place your settings in this file to overwrite the default settings
{
"eslint.enable": false,
"jshint.enable": true,
"files.trimTrailingWhitespace": true
}