Skip to content

Instantly share code, notes, and snippets.

View danwarfel's full-sized avatar

Dan danwarfel

View GitHub Profile
@danwarfel
danwarfel / pySimpleServer.py
Created November 9, 2017 20:37
Simple HTTP Server in Python
python -m SimpleHTTPServer 8000
@danwarfel
danwarfel / anchor-hi-life.css
Last active November 30, 2017 11:56
WIRED Magazine's anchor tag styling.
.link-underline a {
border-bottom: 3px solid #b4e7f8;
border-bottom-width: 3px;
border-bottom-style: solid;
border-bottom-color: rgb(180, 231, 248);
box-shadow: inset 0 -4px 0 #b4e7f8;
color: inherit;
-webkit-transition: background .15s cubic-bezier(.33,.66,.66,1);
-moz-transition: background .15s cubic-bezier(.33,.66,.66,1);
-o-transition: background .15s cubic-bezier(.33,.66,.66,1);
@danwarfel
danwarfel / dev-tools-monitor-events.js
Created August 15, 2016 21:04
Monitor Events in Chrome Developer Tools
monitorEvents(window, "click")
@danwarfel
danwarfel / emmet-cheat-sheet.html
Last active January 1, 2018 18:35
Emmet Cheat Sheet
<!-- HOW TO MANIPULATE IMAGES -->
<!-- New Ones -->
img[src=$$$.jpg]*40
<!--You can combine attributes into a single set -->
img[src=/images/$$.png alt]
<!-- THESE ARE PARTICULARLY USEFUL -->
<!-- Climbing Up #1 -->
@danwarfel
danwarfel / SoundCloud find user client ID
Last active August 6, 2016 13:23
SoundCloud find user client ID
http://api.soundcloud.com/resolve?url=http://soundcloud.com/USER_NAME&client_id=YOUR_CLIENT_ID
@danwarfel
danwarfel / iterating-with-getelementsbyclassname-and-foreach.js
Last active February 4, 2023 18:18
Iterating Over Result Of getElementsByClassName Using Array forEach
var els = document.getElementsByClassName("myclass"); // Creates an HTMLObjectList not an array.
Array.prototype.forEach.call(els, function(el) {
// Do stuff here
console.log(el.tagName);
});
// Or
[].forEach.call(els, function (el) {...}); // Creates array on the fly.
# BEGIN GZIP
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>
# END GZIP
<!-- bad -->
<div id="main">
<div class="article">
<div class="header">
<h1>Blog post</h1>
<p>Published: <span>21st Feb, 2015</span></p>
</div>
<p>…</p>
</div>
</div>
@danwarfel
danwarfel / terse.html
Created March 8, 2016 04:33
Terse HTML5 skeleton, eschews XHTML habits entirely
<!-- good -->
<!doctype html>
<html lang=en>
<meta charset=utf-8>
<title>Contact</title>
<link rel=stylesheet href=style.css>
<h1>Contact me</h1>
<label>
Email address:
/* box-shadow underline */
.content a:not(.btn) {
box-shadow: inset 0 -5px 0 #ff772f;
color: inherit;
padding: 0 2px;
margin: 0 -2px;
display: inline-block;
}
/* hightlight on hover */