Skip to content

Instantly share code, notes, and snippets.

@sergeicodes
sergeicodes / accessibility.md
Last active July 15, 2019 19:07
Info collected about accessibility topics.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sergeicodes
sergeicodes / gh-pages-deploy.md
Created March 13, 2017 20:21 — 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).

// http://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb
function hexToRgb(hex) {
// Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
hex = hex.replace(shorthandRegex, function(m, r, g, b) {
return r + r + g + g + b + b;
});
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
@sergeicodes
sergeicodes / colors.js
Last active July 2, 2020 17:32
colors
var colors = [
{
"name": "AliceBlue",
"hex": "#f0f8ff",
"rgb": "rgb(240, 248, 255)",
"tone": "white"
},
{
"name": "AntiqueWhite",
"hex": "#faebd7",