See demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <meta charset="utf-8" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
| <link rel="icon" type="image/png" href="{{ siteUrl }}favicon.png"> | |
| <title>{% if homeTitle is defined %}{{ siteName }} | {{ entry.homeTitle }}{% elseif entry.title is defined %}{{ entry.title }} | {{ siteName }}{% else %}{{ title }} | {{ siteName }}{% endif %}</title> | |
| <link rel="stylesheet" href="{{ siteUrl }}assets/css/app.css" /> | |
| <script src="{{ siteUrl }}assets/bower_components/modernizr/modernizr.js"></script> | |
| <!-- General Page Meta --> | |
| {% if entry.seoDescription is defined %} | |
| {% if entry.seoDescription is not empty %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Varnish 4.0 configuration for Craft | |
| # | |
| # Based on the following: | |
| # - https://github.com/mattiasgeniar/varnish-4.0-configuration-templates/blob/master/default.vcl | |
| # - https://gist.github.com/aelvan/eba03969f91c1bd51c40 | |
| vcl 4.0; | |
| import std; | |
| import directors; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var {handleResponse} = require('.utils') | |
| var {setErrorMessages} = require('./messages') | |
| var CHECK_TOKEN = 'auth/CHECK_TOKEN' | |
| var CHECK_TOKEN_FAILURE = 'auth/CHECK_TOKEN_FAILURE' | |
| var CHECK_TOKEN_SUCCESS = 'auth/CHECK_TOKEN_SUCCESS' | |
| var LOGIN = 'auth/LOGIN' | |
| var LOGIN_FAILURE = 'auth/LOGIN_FAILURE' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This is a sample build configuration for Javascript (Node.js). | |
| # Check our guides at https://confluence.atlassian.com/x/14UWN for more examples. | |
| # Only use spaces to indent your .yml configuration. | |
| # ----- | |
| # You can specify a custom docker image from Docker Hub as your build environment. | |
| image: node:7.8.0 | |
| pipelines: | |
| default: | |
| - step: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function int32ToBytes (int) { | |
| return [ | |
| int & 0xff, | |
| (int >> 8) & 0xff, | |
| (int >> 16) & 0xff, | |
| (int >> 24) & 0xff | |
| ] | |
| } | |
| // 3 (base 10) = 00000000000000000000000000000011 (base 2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ; Fibonacci | |
| ; executable with https://schweigi.github.io/assembler-simulator/ | |
| ; Result is in register A | |
| JMP .start | |
| ; fib(n) <- n is in register A | |
| fib: | |
| CMP A, 1 ; compare n to a | |
| JE .fibReturnOne | |
| JB .fibReturnZero |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * These hooks re-implement the now removed useBlocker and usePrompt hooks in 'react-router-dom'. | |
| * Thanks for the idea @piecyk https://github.com/remix-run/react-router/issues/8139#issuecomment-953816315 | |
| * Source: https://github.com/remix-run/react-router/commit/256cad70d3fd4500b1abcfea66f3ee622fb90874#diff-b60f1a2d4276b2a605c05e19816634111de2e8a4186fe9dd7de8e344b65ed4d3L344-L381 | |
| */ | |
| import { useContext, useEffect, useCallback } from 'react'; | |
| import { UNSAFE_NavigationContext as NavigationContext } from 'react-router-dom'; | |
| /** | |
| * Blocks all navigation attempts. This is useful for preventing the page from | |
| * changing until some condition is met, like saving form data. |
Made this example to show how to use Next.js router for a 100% SPA (no JS server) app.
You use Next.js router like normally, but don't define getStaticProps and such. Instead you do client-only fetching with swr, react-query, or similar methods.
You can generate HTML fallback for the page if there's something meaningful to show before you "know" the params. (Remember, HTML is static, so it can't respond to dynamic query. But it can be different per route.)
Don't like Next? Here's how to do the same in Gatsby.