Skip to content

Instantly share code, notes, and snippets.

View adamschwartz's full-sized avatar

Adam Schwartz adamschwartz

View GitHub Profile
@adamschwartz
adamschwartz / link-underlines.styl
Created November 1, 2014 02:32
Descender-aware link underlines
Verifying I am +adamschwartz on my passcard. https://onename.com/adamschwartz
var getBrowserZoom = function() {
return window.outerWidth / (document.body.clientWidth + parseInt(getComputedStyle(document.body)['margin-left'], 10) + parseInt(getComputedStyle(document.body)['margin-left'], 10))
};
@adamschwartz
adamschwartz / unselectable.css
Created October 13, 2013 22:58
Unselectable
.unselectable {
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: -moz-none;
-ms-user-select: none;
user-select: none;
-webkit-touch-callout: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
@adamschwartz
adamschwartz / instant-flat-ui.js
Last active December 27, 2015 15:39
"Instant" "Flat" "UI"™ — Run this bookmarklet on any page to make it "flat".
var d = document.createElement('div');
d.innerHTML = '\
<style>\
*:not(.icon):not(i), *:not(.icon):not(i):after, *:not(.icon):not(i):before {\
box-shadow: none !important;\
text-shadow: none !important;\
background-image: none !important;\
}\
*:not(.icon):not(i) {\
border-color: transparent !important;\
  1. Plain Strings (207): foo
  2. Anchors (208): k$
  3. Ranges (202): [a-f]{4}
  4. Backrefs (201): (...).*\1
  5. Abba (190): ^((?!(.)(.)\3\2).)*$ (Source)
  6. A man, a plan (177): ^(.)[^p].*\1$
  7. Prime (286): ^(?!(..+)\1+$)
  8. Four (199): (.)(.\1){3}
  9. Order (199): ^[^o]?.{5}$
  10. Triples (588): (00[039]|12|015|50)$|1..?4|4.2|1.7|6.0|006 (Source)
@adamschwartz
adamschwartz / wedge.html
Created July 28, 2016 19:15
Angled wedge SVG CSS
<style>
section {
height: 25vh;
background: #fff;
text-align: center;
font-family: Avenir Next, sans-serif;
line-height: 25vh;
font-size: 19px;
}
@adamschwartz
adamschwartz / share.html
Created August 11, 2016 18:25
Facebook, Twitter, and email share icons
<style>
html {
box-sizing: border-box;
font-family: "Avenir Next", sans-serif;
}
html * {
box-sizing: inherit;
}
.share {
width: 15em;
<style>
body {
margin: 0;
background: #e0e0e0;
}
.column {
width: 532px;
max-width: 100%;
margin: auto;
<style>
.ex div {
position: relative;
margin: 40px;
color: #000;
font-size: 32px;
line-height: 1;
}
.ex div::before {