Skip to content

Instantly share code, notes, and snippets.

import {Route, Link, Switch} from './RelativeRouting';
const RRExample = () => <div>
<Link relative to="/more">Show more</Link>
<Link relative to="/more/summary">Show more (summary)</Link>
<Link to="/home">go to home (absolute)</Link>
<Switch>
<Route to="/more/summary" component={ShowSummary}/>
<Route to="/more" component={ShowDetails}/>
@meiriko
meiriko / RelativeRouting.js
Last active January 12, 2019 12:46
RelativeRouting.js
import React from 'react';
import {
Route as BaseRoute,
Switch as BaseSwitch,
Link as BaseLink,
NavLink as BaseNavLink,
withRouter
} from 'react-router-dom';
import { withProps, mapProps, branch, compose } from 'recompose';
@meiriko
meiriko / index.html
Last active September 29, 2016 13:26
Download external zip file via node for Omer
<!-- IMPORTANT. Put me under the /static dir, gist has flat files -->
<html>
<head>
</head>
<body>
<div>dl example</div>
<div><a href="/dlzip/http://www.7-zip.org/a/7za920.zip">dl: http://www.7-zip.org/a/7za920.zip via server</a></div>
<div><button onClick="goto('/dlzip/http://www.7-zip.org/a/7za920.zip')">navigate by click (js)</button></div>
<script>
function goto(url){
@meiriko
meiriko / index.html
Created September 5, 2016 19:44
Luluuuuuuu
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Luluuuuuuuuuuuu</title>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.min.js"></script>
<style type="text/css">
body {
background: #222;
<script>
alert('kuku');
</script>
@meiriko
meiriko / index.html
Last active September 5, 2016 19:16
צנימי המעצבנת
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>צנימי מעצבנת</title>
<!--<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.25.0"></script>-->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.min.js"></script>
<style type="text/css">
body {
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>צנימי</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.25.0"></script>
<style type="text/css">
body {
background: #222;