Skip to content

Instantly share code, notes, and snippets.

Working from home

Newton iamnewton

Working from home
View GitHub Profile
iamnewton /
Created Jul 21, 2015
Cross-Browser Text Masks with Blend Modes

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


View 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 /
Created May 28, 2015
All elements in the flow of the document that proceed other elements must receive a top margin of one line.
iamnewton / stocks
Created Apr 24, 2015
Allows you to grab stocks from a CLI
View stocks
#!/usr/bin/env bash
# Author:
# Newton (@chrisohpedia)
# Description:
# Get stock quotes
# Dependencies:
# None
View markdown.css
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
View spoiler-filter.css
.spoiler {
filter: blur(20px);
transition-property: -webkit-filter;
transition-duration: .4s;
.spoiler:hover, .spoiler:focus {
filter: blur(0px);
iamnewton /
Created Mar 11, 2015
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 / web-notifications.js
Created Mar 10, 2015
Web Notifications API
View web-notifications.js
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!' });
View _aspect-ratio.scss
@mixin aspect-ratio($width, $height) {
position: relative;
&:before {
display: block;
content: "";
width: 100%;
padding-top: ($height / $width) * 100%;
> .content {
position: absolute;
View qualify.css
.button {
border: none;
button.button {
-webkit-appearance: none;
a.button {
text-decoration: none;
You can’t perform that action at this time.