Scripts posted recently by nando.quintana in Kelpi

1- 10 of 245.

FREETYPE2 instalatio log

to freetype log txt by nando.quintana

running install
running build
running build_py
running build_ext
building '_imagingft' extension

Sustituir la portada de un pdf por otra

to pdf pdftk by nando.quintana

pdftk A=portada.pdf B=informe.pdf cat A B2-end output combined.pdf

zodb and cherrypy working together

to python zodb cherrypy by nando.quintana

# easy_install ZODB3
# easy_install cherrypy
import cherrypy
import cgi
from ZODB import FileStorage, DB

launch a unix command from Python

to python unix linux command by nando.quintana

LOG_FILE_NAME = "access.log"
OLD_LOG_FILE_NAME = "old.log
from os import spawnlp, P_WAIT
spawnlp(P_WAIT, 'cp', 'cp', LOG_FILE_NAME, OLD_LOG_FILE_NAME)

Handle utf8 within URL format strings

to javascript utf8 by nando.quintana

if (encodeURIComponent) {
    title = encodeURIComponent($("#id_title").val());
    descripcion = encodeURIComponent($("#id_description").val());
    tag_list = encodeURIComponent($("#id_tag_list").val());
  } else {

Concatenar PDFs con pdftk

to bash pdftk pdf by nando.quintana

#!/bin/bash
pdftk uno.pdf dos.pdf tres.pdf cuatro.pdf cinco.pdf cat output definitivo.pdf

filtrar resultados cuyo id esté en un conjunto dado

to django sql id by nando.quintana

if distinct_ids != []:
   ids = "("+", ".join(distinct_ids)+")"
   commented_photos = Photo.objects.extra(where=['id IN '+ids])

remove CDATA from text using regular expressions

to regular expressions python cdata by nando.quintana

import re
content= """...<![CDATA[donostia-san sebastian]]>..."""
REGEXP = "<!\[CDATA\[(?P<text>[^\]]*)\]\]>"
regexp = re.compile(REGEXP)
content = regexp.sub('\g<text>',content)
hits counter