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
/** | |
* Here using data-attributes, but you could use className, or render props as well | |
*/ | |
import React from 'react'; | |
import Link, { LinkProps } from 'next/link'; | |
import { useRouter } from 'next/router'; | |
const ActiveLink: React.FC<LinkProps> = props => { | |
const router = useRouter(); |
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
import React from 'react'; | |
import ErrorPage from 'next/error'; | |
// Allow to render the error page + return the correct error code with SSR | |
// It is a hack and has the disadvantage of logging this server-side | |
// https://github.com/zeit/next.js/issues/4451 | |
// A better solution is welcome. | |
export const render404Error = () => { | |
if (process.browser) { |
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
/** | |
* Small JS exercices | |
* Consider all exercises independant from each other and running in their own scope | |
* | |
*/ | |
/** | |
* What is the output of this piece of code? | |
* | |
*/ |
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
# Will make autocomplete trigger with 'enter' instead of 'tab' | |
'atom-text-editor:not(mini) .autocomplete-plus.autocomplete-suggestion-list': | |
'tab': 'unset!' | |
'enter': 'autocomplete-plus:confirm' | |
# Use 'expand-abbreviation' instead of 'expand-abbreviation-with-tab' for tab keybinding | |
'.pane .editor:not(.mini)': | |
'tab': 'emmet:expand-abbreviation' |
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
<!-- Map --> | |
<div id="map_canvas" class="relative" style="height:600px;z-index: 4;"></div> | |
<!-- Maps Generator --> | |
<script src="http://maps.google.com/maps/api/js?sensor=false"></script> | |
<script> | |
window.onload = function() { | |
initialize(); | |
} |