Skip to content

Instantly share code, notes, and snippets.

@edwinwright
edwinwright / gh-pages-deploy.md
Created September 6, 2016 20:49 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@edwinwright
edwinwright / README.md
Last active May 29, 2018 08:22
Naming things in web development
@edwinwright
edwinwright / flexbox-sticky-footer-3.markdown
Created August 11, 2016 13:03
Flexbox Sticky Footer 3
@edwinwright
edwinwright / 0_reuse_code.js
Created June 3, 2016 10:00
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

Responsive Scrolling Tabs

Magic tabs that resize themselves according to their container's width. Tab widths default to a percentage value, which is set automatically in CSS by counting child elements. If a tab's content overflows its available width, then the tabs adjust their widths to fit. If they can't fit on the screen then the tabs start to scroll horizontally.

A Pen by Ed Wright on CodePen.

License.

@edwinwright
edwinwright / D3 Scatterplot Chart.md
Last active March 11, 2022 13:24
Population by City (+100k)

A scatterplot chart representing the following variables:

  • x: longitude (quantitive)
  • y: latitude (quantitive)
  • area: population (quantitive)
  • color: population (quantitive)
@edwinwright
edwinwright / umd-script-boilerplate.js
Last active August 29, 2015 14:27 — forked from cferdinandi/umd-script-boilerplate.js
A simple boilerplate for UMD JS modules.
(function (root, factory) {
if ( typeof define === 'function' && define.amd ) {
define([], factory(root));
} else if ( typeof exports === 'object' ) {
module.exports = factory(root);
} else {
root.myPlugin = factory(root);
}
})(typeof global !== "undefined" ? global : this.window || this.global, function (root) {

HTML5 Design Patterns - Figure

<a href="#fig1">Figure 1</a>
[...]
<figure id="fig1" role="group" aria-labelledby="caption">
  <figcaption id="caption">Code example</figcaption>
  <pre>
    [...]
 

HTML5 Design Patterns - Details

<details role="group">
  <summary role="button" aria-expanded="false">Course schedule</summary>
  <table>
    <tr>
      <th>Start date</th>
      <th>End date</th>
 Duration

HTML5 Design Patterns - Sections

<section role="region" aria-labelledby="heading">
  <h1 id="heading">Weather report</h1>
  [...]
</section>