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
function load() { | |
app = document.querySelector('sc-app'); | |
a =[ {"label": "Decorrido do prazo" , "value": 120, "unit": "minutos"}, {"label": "Decorrido do prazo" , "value": 310, "unit": "minutos"}, {"label": "Decorrido do prazo" , "value": 150, "unit": "minutos"}, {"label": "GSTIDFCOC" , "value": 50, "unit": "minutos"}, | |
{"label": "Tempo restante", "value": 230, "unit": "minutos"}]; | |
b =[ {"label": "Decorrido do prazo" , "value": 30, "unit": "minutos"}, | |
{"label": "Tempo restante", "value": 70, "unit": "minutos"}]; | |
app.$.termobar.data = a; | |
} |
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
<!-- ... omitted ... --> | |
<body> | |
<!-- | |
In this case, I have passed variable of template in the attributes of the element sc-navbar. | |
NOTE: I did change of '{{' to '%%' for display the variables from Flask template engine. This help us | |
to see difference of the Flask for Polymer scopes. | |
I'm using g (global variable) of the Flask (see more: http://flask.pocoo.org/docs/0.10/templating/#standard-context) | |
--> | |
<sc-navbar username="%% g.user.shortname %%" avatar="%% g.user.md5_email %%" online="%% g.user.status_online %%"></sc-navbar> | |
</body> |
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
# -*- coding: UTF-8 -*-# | |
# | |
# Isto é um fragmento de código para traduzir certos pydoc's | |
# que usa o goslate de https://pypi.python.org/pypi/goslate | |
# LEMBRE: que o Google Tradutor faz traduções literais que | |
# às vezes pode não fazer sentido. Assim você que dará sentido | |
# ao texto traduzido conforme o contexto. | |
# | |
# Foi criado para o curso Python X-Series (101x). Por isso é | |
# interesse que você não copie este código. Assim, abra um |
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 scrapy.selector import Selector | |
selector = Selector(text=""" | |
<div itemscope itemtype ="http://schema.org/Movie"> | |
<h1 itemprop="name">Avatar</h1> | |
<span>Director: <span itemprop="director">James Cameron</span> (born August 16, 1954)</span> | |
<span itemprop="genre">Science fiction</span> | |
<a href="../movies/avatar-theatrical-trailer.html" itemprop="trailer">Trailer</a> | |
</div>""", type="html") |
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
// assumes you add a timestamp field to each record (see Firebase.ServerValue.TIMESTAMP) | |
// pros: fast and done server-side (less bandwidth, faster response), simple | |
// cons: a few bytes on each record for the timestamp | |
var ref = new Firebase(...); | |
ref.orderByChild('timestamp').startAt(Date.now()).on('child_added', function(snapshot) { | |
console.log('new record', snap.key()); | |
}); |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
__author__ = "Adrien Pujol - http://www.crashdump.fr/" | |
__copyright__ = "Copyright 2013, Adrien Pujol" | |
__license__ = "Mozilla Public License" | |
__version__ = "0.3" | |
__email__ = "[email protected]" | |
__status__ = "Development" | |
__doc__ = "Check a TLS certificate validity." |
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, render_template_string, request | |
class CustomFlask(Flask): | |
jinja_options = Flask.jinja_options.copy() | |
jinja_options.update(dict( | |
block_start_string='<%', | |
block_end_string='%>', | |
variable_start_string='%%', | |
variable_end_string='%%', | |
comment_start_string='<#', |