Skip to content

Instantly share code, notes, and snippets.

@akirchmyer
akirchmyer / index.html
Created November 24, 2017 21:46
testing out colors & images for upcoming site.
<div class="tools">
<strong>LOGO: </strong>
<ul class="logos">
<li><a href="#" data-logo-url="http://acetutor.dev:8080/wp-content/themes/acetutor/dist/images/bulldog.png">Logo 1</a></li>
<li><a href="#" data-logo-url="http://acetutor.dev:8080/wp-content/themes/acetutor/dist/images/cathorizontal.png">Logo 2</a></li>
<li><a href="#" data-logo-url="http://acetutor.dev:8080/wp-content/themes/acetutor/dist/images/catvertical.png">Logo 3</a></li>
<li><a href="#" data-logo-url="http://acetutor.dev:8080/wp-content/themes/acetutor/dist/images/cathat.png">Logo 4</a></li>
<li><a href="#" data-logo-url="http://acetutor.dev:8080/wp-content/themes/acetutor/dist/images/bulldog2.png">Logo 5</a></li>
</ul>
<strong>COLORS:</strong>
@akirchmyer
akirchmyer / gist:af160ec74f0feadc3170d3ca3e27ea27
Created March 9, 2017 22:37
Log what elements are being focused as you tab
function logActive() {
let active = document.activeElement;
return setInterval(() => {
if (active !== document.activeElement) {
active = document.activeElement;
console.log('New active element:', active);
}
}, 400);
}
logActive();
@akirchmyer
akirchmyer / script.js
Last active August 29, 2015 14:02
Using QUnit to test promise success and failure
var app = {
model: {}
};
/**
* Get an attribute from the model.
* fetch() will make an async call for data from some api and call 'callback' on completion.
* 'callback' will resolve the returned promise with the fetched attribute value.
*/
app.model.getAttributeLater = function (attribute) {
var dfd = $.Deferred();

regexes: backwards referencing, capturing, exec vs match, passive subexpressions, String.replace()

advanced regex uses from Secrets of the JavaScript Ninja

A Pen by Andrew Kirchmyer on CodePen.

License.

@akirchmyer
akirchmyer / call()-and-apply().markdown
Created November 18, 2013 13:42
A Pen by Andrew Kirchmyer.
@akirchmyer
akirchmyer / index.html
Created November 17, 2013 05:25
A Pen by Andrew Kirchmyer.
<a href="http://synacor.com" id="link1">New Window</a>
<a href="http://synacor.com" id="link2">Same Window</a>
<a href="http://synacor.com" id="link3">Location Info</a>
@akirchmyer
akirchmyer / index.html
Created November 17, 2013 05:25
A Pen by Andrew Kirchmyer.
<div id="results"></div>
@akirchmyer
akirchmyer / index.html
Created November 17, 2013 05:23
A Pen by Andrew Kirchmyer.
<div class="rises"> </div>
<div class="fades"> <div class="label">Hover me!</div> </div>
<div class="other"> </div>