Skip to content

Instantly share code, notes, and snippets.

View fuczak's full-sized avatar

Damian Prus fuczak

  • Miinto
  • Warsaw
View GitHub Profile
@fuczak
fuczak / routes.json
Created October 18, 2016 15:03
[json-server]:routes
{
"/api": "",
"/account/list": "/accounts",
"/account/me": "/accounts/1",
"/accounts/:id/integrations": "/integrations_:id",
"/accounts/:id/mappings": "/mappings?_expand=integration&_expand=variant&_omit=integrationId&_omit=variantId"
}
@fuczak
fuczak / db.json
Last active October 18, 2016 15:03
[json-server]:db
{
"accounts": [
{
"id": 1,
"name": "SHWRM"
},
{
"id": 2,
"name": "Nie SHWRM"
}
@fuczak
fuczak / plural.js
Last active October 18, 2016 15:04
[json-server]:server_router
var express = require('express')
var _ = require('lodash')
var pluralize = require('pluralize')
var utils = require('../utils')
module.exports = function (db, name) {
// Create router
var router = express.Router()
// Embed function used in GET /name and GET /name/id
@fuczak
fuczak / sm-annotated.html
Created October 13, 2015 19:19 — forked from hdragomir/sm-annotated.html
The deferred font loading logic for Smashing Magazine. http://www.smashingmagazine.com/
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);

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).