Skip to content

Instantly share code, notes, and snippets.

@joshcanhelp
joshcanhelp / scrollTo.js
Last active January 28, 2022 13:21
Animated scrollTo for specific element or top of page
//
// Smooth scroll-to inspired by:
// http://stackoverflow.com/a/24559613/728480
//
module.exports = function (scrollTo, scrollDuration) {
//
// Set a default for where we're scrolling to
//
@bradoyler
bradoyler / declaring.js
Last active August 29, 2015 13:56
JS console Lesson #1: declaring functions.
// 1. declare a "named" function
function myNamedFunction(){ return true; }
// assertions
console.log(typeof window.myNamedFunction === "function"); // true
console.log(myNamedFunction.name === "myNamedFunction"); // true
// 2. declare anonymous function
var myAnonymousFunction = function(){ return true; };
//assertions
console.log(typeof window.myAnonymousFunction === "function"); // true
@lensco
lensco / Custom.css
Created August 18, 2011 11:28
User stylesheet to customize the WebKit Inspector (cleaning up and improving the styles panel). See http://bricss.net/post/9076968710/customize-the-webkit-inspector-chrome-dev-tools
.monospace {
font: 11px/1.3 Monaco !important;
}
/* slightly larger indentation of source code */
.outline-disclosure ol {
-webkit-padding-start: 18px !important;
}
/* margin underneath styles panel heading */