This file contains 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
from flask import Flask | |
from flask_sqlalchemy import SQLAlchemy | |
import os | |
import graphene | |
from graphene_sqlalchemy import SQLAlchemyObjectType, SQLAlchemyConnectionField | |
from flask_graphql import GraphQLView | |
################################# | |
app = Flask(__name__) | |
app.debug = True |
This file contains 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
{% extends "layout_new.html" %} | |
{% block content_main %} | |
<div class="content-section"> | |
<form method="POST" action=""> | |
{{ form.hidden_tag() }} | |
<fieldset class="form-group"> | |
<legend class="border-bottom mb-4">User Choices</legend> | |
{% if form.choices.errors %} | |
<div class="invalid-feedback"> | |
{% for error in form.choices.errors %} |
This file contains 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 $ from 'jquery' | |
import './styles.scss' | |
import CarouselControls from '../CarouselControls' | |
import CarouselDots from '../CarouselDots' | |
import CarouselSlider from '../CarouselSlider' | |
import mod from '../../lib/mod' | |
class CarouselBlock { |
This file contains 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
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works | |
const axios = require('axios'); // promised based requests - like fetch() | |
function getCoffee() { | |
return new Promise(resolve => { | |
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee | |
}); | |
} |
This file contains 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
<form method="post" action=""> | |
{{ form.name}} | |
{{ form.hidden_tag() }} | |
<br/> | |
{% for entry in form.hours %} | |
{{ loop.index0|dow }} | |
{{ entry() }} | |
{% endfor %} | |
<input type="submit"/> | |
</form> |
This file contains 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
/* Useful celery config. | |
app = Celery('tasks', | |
broker='redis://localhost:6379', | |
backend='redis://localhost:6379') | |
app.conf.update( | |
CELERY_TASK_RESULT_EXPIRES=3600, | |
CELERY_QUEUES=( | |
Queue('default', routing_key='tasks.#'), |
This file contains 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
# Copy of http://stackoverflow.com/a/20104705 | |
from flask import Flask, render_template | |
from flask_sockets import Sockets | |
app = Flask(__name__) | |
app.debug = True | |
sockets = Sockets(app) | |
@sockets.route('/echo') |
This file contains 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
{ | |
"estados": [ | |
{ | |
"sigla": "AC", | |
"nome": "Acre", | |
"cidades": [ | |
"Acrelândia", | |
"Assis Brasil", | |
"Brasiléia", | |
"Bujari", |