Settings
,Editor
,Invisibles
. TickShow Indent Guide
andShow Invisibles
.
To install all the universally recommended plugins, in Terminal run:
$(document).ready(function() { | |
$(document).on('click keypress', function(event) { | |
if (event.type == 'click' || event.which == 13) { | |
$(event.target).trigger('activate'); | |
} | |
}); | |
$("button").on('activate', function() { | |
alert('Button activated!'); | |
}); | |
}); |
<!------------------------ AboutPage layout --> | |
<header> | |
<!-- Header stuff --> | |
<header> | |
<% include HeroBanner %> | |
{$HeroBannerContent} | |
<% end_include %> | |
{$Content} | |
<footer> |
// Fixes some browsers allowing invalid forms to submit, mostly an issue with Safari allowing empty required fields. | |
// http://caniuse.com/#search=required | |
window.addEventListener('submit', (event) => { | |
if (!event.target.noValidate && !event.target.checkValidity()) { | |
event.preventDefault() | |
window.alert('Please correct invalid form fields and resubmit.') | |
} | |
}) |
⚠️ This article is outdated: CSS in JS is far superior to Sass, and font icons are no longer a good idea. Use inline SVG React components and in certain situations plain old.svg
files inimg
tags.
Icon fonts have been been best-practice for a while now. They allow us to use tons of fully styleable cross-browser vector icons with one lightweight HTTP request.
Folk typically use font icons via non-semantic presentational markup such as class="icon icon-happy-face"
that should be avoided. With a pinch of Sass you can add icons to elements purely via your stylesheet using easy to remember names, without polluting your markup. Yay!
Ever tried sudo gem cleanup
in OS X Mavericks only to be hit with errors like this?
Attempting to uninstall sqlite3-1.3.7
Unable to uninstall sqlite3-1.3.7:
Gem::InstallError: sqlite3 is not installed in GEM_HOME, try:
gem uninstall -i /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/gems/2.0.0 sqlite3
⚠️ This article is outdated: First I moved on to a custom Gulp workflow, then for a while I used SVG symbols and external references with a polyfill. Now I use inline SVG React components, and occasionally plain old.svg
files inimg
tags.
Here we take “Fun with Sass & font icons” to the next level by automating the tedious stuff, including the actual font generation.
Manage all your project’s font icons in one folder as nicely named SVG files. Add icons to this folder to have your fonts magically rebuilt and your Sass automatically set up for you to start using the icons via their nice names; without touching your markup or dealing with non-semantic class names.
What are the perks?
There are several tricks to writing efficient CSS animations that few people seem aware of. Most people borrow directly from common libraries such as Animate.css without realising how bloated they are.
You can:
import { ApolloLink } from 'apollo-link' | |
const createTokenLink = ({ getToken }) => | |
new ApolloLink((operation, forward) => { | |
const token = getToken() | |
if (token) | |
operation.setContext({ | |
headers: { | |
authorization: `Bearer ${token}` | |
} |
GRAPHQL_URI=http://localhost:3001/graphql |