Skip to content

Instantly share code, notes, and snippets.

View alex3165's full-sized avatar
🇫🇷

Alexandre Rieux alex3165

🇫🇷
View GitHub Profile
import ReactMapboxGl, { Layer, Feature } from “../src/index”;
<ReactMapboxGl
style=“style”
center={this.state.center}
zoom={this.state.zoom}
accessToken={accessToken}
containerStyle={containerStyle}>
<ReactMapboxGl
style={style}
center={this.state.center}
zoom={this.state.zoom}
accessToken={accessToken}
onDrag={this._onDrag}
containerStyle={containerStyle}>
<ZoomControl
zoomDiff={1}
import * as React from 'react';
declare interface LoadingProps {
color? : string;
height? : any;
width? : any;
type? : string;
}
declare interface LoadingState {
@alex3165
alex3165 / mvt
Last active October 4, 2016 13:34
class Button extends React.Component {
static defaultProps = {
color: 'blue'
}
render() {
return (
<div style={{
color: this.props.color
const oauthUserEpic = (action$) => {
let horribleSideEffect;
return action$
.ofType(OAUTH_USER)
.concatMap(({ token }) => {
horribleSideEffect = token;
return get({
endpoint: 'user',
params: { access_token: token }
import * as Ajv from 'ajv';
import swaggerDefinition from './my-swagger-definition';
import { Request, Response, NextFunction } from 'express';
const ajv = Ajv({ allErrors: true });
// validation middleware
const validateSchema = (schema: UserResSchema) => {
return (req: Request, res: Response, next: NextFunction) => {
function Node(data) {
this.data = data;
this.children = [];
}
class Tree {
constructor(rootData) {
this.root = new Node(rootData);
}
'use strict'
const https = require('https');
const data = JSON.stringify({});
const getOptions = (code) => {
return {
host: 'github.com',
method: 'POST',
@alex3165
alex3165 / Index.js
Last active May 31, 2019 14:20
Javascript copy vs ref
const a = { byId: {} }
// b is a reference to a, any change on a will mutate b
const b = a
// c is shallow copy of a, any change on the top level properties of a will not affect c although any change of nested object would affect c, if we mutate byId in a it will update byId in c
const c = { ...a }
//or
const cprime = Object.assign({}, a)

Keybase proof

I hereby claim:

  • I am alex3165 on github.
  • I am alex3165 (https://keybase.io/alex3165) on keybase.
  • I have a public key ASCXKIsitiBTEviQJU0sEw-NP9r9RB_Qqj-JuJqP3cwvYgo

To claim this, I am signing this object: