Skip to content

Instantly share code, notes, and snippets.

DELETE FROM envsite.treepagein
WHERE ctid NOT IN (SELECT min(b.ctid)
FROM envsite.treepagein b
GROUP BY id_treepage, id_treepage
HAVING count(*) > 1);
import urllib
import json
def getRSS():
"""
Retorna o forecast do google para BSB
{'low':15,
'high':26,
'cond':'Possibilidade de tempestade',
'ico':'/ig/images/weather/chance_of_storm.gif'}
JAVASCRIPT
// unhappily had to do this, enconding error could not be resolve by now
// maybe sometime come back and resolve this, but anyway this works :)
function gamb(val){
return val.replace("í", "ii").replace("á", "aa").replace("é", "ee").replace("ó", "oo").replace("ú", "uu").replace("ã", "aaa").replace("ç", "ccc").replace("ô", "do");
}
PYTHON
def gamb(val):
#!/usr/bin/python2.6
# -*- encoding: LATIN1 -*-
#
# Copyright 2010 Prima Tech.
#
# Licensed under the Environ License, Version 1.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.intip.com.br/licenses/ENVIRON-LICENSE-1.0
<span class="image" tal:define="req python: here.request">
<img tal:attributes="data-original feature/image; alt python: mkAltTitle(feature['title'], feature.get('credits')); title python: mkAltTitle(feature['title'], feature.get('credits'))" tal:condition="python:not req.get('diagramar')">
<noscript tal:omit-tag="python:req.get('diagramar')">
<img tal:attributes="src feature/image; alt python: mkAltTitle(feature['title'], feature.get('credits')); title python: mkAltTitle(feature['title'], feature.get('credits'))">
</noscript>
</span>
#!/usr/bin/env python
class Editoria(object):
def __init__(self, titulo, url, **kwargs):
self.titulo = titulo
self.url = url
self.json_noticia = None
def get_json_noticia(self):
@decorator_py2json
def estEdtProc(req, k):
"01.08.02 - Cadastrar / Editar Estabelecimento"
from mod_pga.db.pga_ehf_esthorafuncionamento import instancia as cehf
from mod_pga.db.pga_esp_estprodutoservico import instancia as cesp
from mod_pga.db.pga_efp_estformapagamento import instancia as cefp
from mod_pga.db.pga_est_estabelecimento import instancia as cest
from mod_pga.db.pga_epc_estpalavrachave import instancia as cepc
from mod_pga.db.pga_esa_estcategoria import instancia as cesa
from mod_pga.db.pga_esl_esttelefone import instancia as cesl
<tal:block tal:define="mod python:getAplicativoByTituloSite('Noticia');" tal:condition="python:atributos['peso'] == '0' and atributos['identificador'] and atributos['limite']">
<tal:block tal:define="itens_ python:scripts['ordenalista'](mod=mod,listarconteudo=listarconteudo,hash=[atributos['identificador']],limite=atributos['limite'], getContent=getContent)">
<tal:block tal:repeat="item itens_">
<div class="line size3of3" tal:condition="python:item['destaque'] == 1">
<div class="destaque_cinema unit" tal:attributes="peso item/peso">
<a tal:attributes="href item/url" alt="" title="">
<div class="unit prs">
<img tal:attributes="src:375x230 python:getUrlByFile(item['imagem_destaque'], id_site=48); alt string:${item/titulo_destaque}"/>
</div>
<div class="desc_destaque_cinema unit">
def getCidsLugarCerto(req,k):
"""
Retorna a lista de cidade por estado
"""
from mod_ppc.db.ppc_cid_cidade import instancia as ccid
from mod_ppc.config import configVars
from mod_gen.util.py2json import py2json as _py2json
from mod_gen.db.db import close
try:
if( typeof utils == 'undefined' ) {
var utils = {};
}
utils.request = {
get : function(param) {
if(document.location.search.length == 0)
return {};
var tmp = {};