Skip to content

Instantly share code, notes, and snippets.

View iamnewton's full-sized avatar
🏠
Working from home

Newton iamnewton

🏠
Working from home
View GitHub Profile
@iamnewton
iamnewton / README.md
Created July 21, 2015 01:32
Cross-Browser Text Masks with Blend Modes

For effective clipping effects, a font that has bold lettering and thick strokes tends to work best.

Source

@iamnewton
iamnewton / bling.js
Last active August 29, 2015 14:23 — forked from paulirish/bling.js
/* bling.js */
window.$ = document.querySelectorAll.bind(document)
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn)
}
NodeList.prototype.__proto__ = Array.prototype
@iamnewton
iamnewton / README.md
Created May 28, 2015 05:45
All elements in the flow of the document that proceed other elements must receive a top margin of one line.
@iamnewton
iamnewton / stocks
Created April 24, 2015 06:41
Allows you to grab stocks from a CLI
#!/usr/bin/env bash
#
# Author:
# Newton (@chrisohpedia)
#
# Description:
# Get stock quotes
#
# Dependencies:
# None
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@iamnewton
iamnewton / spoiler-filter.css
Created March 12, 2015 01:04
Spoiler filter
.spoiler {
filter: blur(20px);
transition-property: -webkit-filter;
transition-duration: .4s;
}
.spoiler:hover, .spoiler:focus {
filter: blur(0px);
}
@iamnewton
iamnewton / fix-javascript-errors.md
Created March 11, 2015 23:31
Strange JavaScript Errors

Below is a list of the strange errors in JavaScript. Different browsers can give you different messages for the same error, so there are several different examples where applicable.

How to read errors?

Before the list, let’s quickly look at the structure of an error message. Understanding the structure helps understand the errors, and you’ll have less trouble if you run into any errors not listed here.

A typical error from Chrome looks like this:

Uncaught TypeError: undefined is not a function
@iamnewton
iamnewton / web-notifications.js
Created March 10, 2015 20:15
Web Notifications API
if ( window.Notification && Notification.permission !== "denied" ) {
Notification.requestPermission( function( status ) { // status is "granted", if accepted by user
var n = new Notification('Title', { body: 'I am the body text!' });
});
}
@mixin aspect-ratio($width, $height) {
position: relative;
&:before {
display: block;
content: "";
width: 100%;
padding-top: ($height / $width) * 100%;
}
> .content {
position: absolute;
.button {
border: none;
}
button.button {
-webkit-appearance: none;
}
a.button {
text-decoration: none;
}