Skip to content

Instantly share code, notes, and snippets.

View baransu's full-sized avatar

Tomasz Cichocinski baransu

View GitHub Profile
---context:global # following code refers to global config
assign turnInstructionMode = 1 # %turnInstructionMode% | Mode for the generated turn instructions | [0=none, 1=auto-choose, 2=locus-style, 3=osmand-style, 4=comment-style, 5=gpsies-style, 6=oruxmaps-style]
assign turnInstructionRoundabouts = true # %turnInstructionRoundabouts% | Set to "false" to avoid generating special turning instructions for roundabouts | boolean
assign turnInstructionCatchingRange = 4
# generate a bike route
assign validForBikes = false
assign validForCars = true
assign validForFoot = false
---context:global # following code refers to global config
assign turnInstructionMode = 1 # %turnInstructionMode% | Mode for the generated turn instructions | [0=none, 1=auto-choose, 2=locus-style, 3=osmand-style, 4=comment-style, 5=gpsies-style, 6=oruxmaps-style]
assign turnInstructionRoundabouts = true # %turnInstructionRoundabouts% | Set to "false" to avoid generating special turning instructions for roundabouts | boolean
assign turnInstructionCatchingRange = 4
# generate a bike route
assign validForBikes = false
assign validForCars = true
assign validForFoot = false
---context:global # following code refers to global config
assign turnInstructionMode = 1 # %turnInstructionMode% | Mode for the generated turn instructions | [0=none, 1=auto-choose, 2=locus-style, 3=osmand-style, 4=comment-style, 5=gpsies-style, 6=oruxmaps-style]
assign turnInstructionRoundabouts = true # %turnInstructionRoundabouts% | Set to "false" to avoid generating special turning instructions for roundabouts | boolean
assign turnInstructionCatchingRange = 4
# generate a bike route
assign validForBikes = false
assign validForCars = true
assign validForFoot = false
@baransu
baransu / OfferComponents.re
Created January 12, 2019 21:55
re-formality complex dynamic form example
module Part = OfferPart;
module Button = OfferButton;
module Styles = OfferStyles;
module Form = OfferForm;
module PartButton = {
let component = ReasonReact.statelessComponent(__MODULE__);
let make =
(
~actions: array(Action.t),
@baransu
baransu / gen-reason-react-bindings.js
Created July 27, 2018 22:17
[WIP] Generate ReasonReact bindings
// @noflow
const { compile, format } = require("reasonably-typed");
const fs = require("fs");
const COMPONENTS = [
"Button",
"Card",
"Center",
"Checkbox",
Error: node_modules/redux-persist/lib/createPersistoid.js.flow:38
38: timeIterator = setInterval(processNextKey, throttle)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ IntervalID. This type is incompatible with
23: let timeIterator: ?number = null
^^^^^^ number
Error: node_modules/redux-persist/lib/createPersistoid.js.flow:46
46: if (timeIterator) clearInterval(timeIterator)
^^^^^^^^^^^^ number. This type is incompatible with the expected param type of
732: declare function clearInterval(intervalId?: IntervalID): void;
const WithColor = ({ children }) => {
const color = /* advanced compuation as fuck */
return children(color);
}
// nasz Component ktory korzysta z render propsow
const Component = () => {
render (
<WithColor>
const Component = (props) => {
return <div props1={props.props1} props2={props.props2}>{props.children}</div>
}
// lub alternatywnie
const Component = ({ children, ...props}) => {
return <div {...props}>{props.children}</div>
}
// no i nasz HOC - higher order component, przyjmuje style i component i zwraca nam nowy component
// easy
let
matherfuckingComplicated = ...
a = 1
in
if True then
a
else
matherfuckingComplicated