Skip to content

Instantly share code, notes, and snippets.

View Ledoux's full-sized avatar

Erwan Ledoux Ledoux

View GitHub Profile
import React, { Fragment } from 'react'
const AddStock = ({ handleAddStock }) => {
const [available, setAvailable] = useState(0)
return (
<Fragment>
<input
onChange={event => setAvailable(event.target.value)}
value={available}
/>
{
"id": "CD",
"name": "Marx et Compagnie",
"stocks": [
{ "available": 15, "id": "AE" },
{ "available": 25, "id": "BF" },
]
}
from flask import current_app as app, jsonify, request
from models import Offer, PcObject, Stock
@app.route('/offers/<id>', methods=['GET'])
@login_required
def get_offer(id):
offer = load_or_404(Offer, id)
return jsonify(offer._asdict(include=["stocks"]))
@app.route('/stocks', methods=['POST'])
@Ledoux
Ledoux / Offer.jsx
Last active April 16, 2019 20:44
pass-Culture Offer Component
class Offer extends Component {
constructor() {
super();
this.state = {
available: 0
};
}
componentDidMount() {
this.props.requestGetOffer();
@Ledoux
Ledoux / text.txt
Created December 12, 2015 13:36
HackRechNum
Projet de loi pour une République numérique
TITRE IER
LA CIRCULATION DES DONNEES ET DU SAVOIR
CHAPITRE IER
ECONOMIE DE LA DONNEE
Section 1
@Ledoux
Ledoux / new.txt
Created December 12, 2015 13:35
HackRepNum
Projet de loi pour une République numérique
TITRE IER
LA CIRCULATION DES DONNEES ET DU SAVOIR
CHAPITRE IER
ECONOMIE DE LA DONNEE
Section 1
@Ledoux
Ledoux / clement.css
Last active December 11, 2015 18:51
Un gist pour Clement
.clement {
color:red;
}