Skip to content

Instantly share code, notes, and snippets.

@jyr
jyr / gist:77342
Created March 11, 2009 06:03
wrapper tumblr
from tumblr import Api
import tumblr
import urllib2
import sys
errors = {
‘403’:”Login o password incorrectos”,
‘404’: “Tumblrblog incorrecto”,
‘urlopen’ : “no ingreso su tumblrblog”
86c86
< def __init__(self, name, email=None, password=None ):
---
> def __init__(self, name, email=None, password=None, date=None, tags=None, format=None):
90a91,93
> self.date = date
> self.tags = tags
> self.format = format
100c103,107
< 'password' : self.password }
$(document).ready(function(){
//Inicializando variables del select
var parentNode = $('select#t_comprobacion').val();
var eventRun = false;
$('select#t_comprobacion').change(function (){
if(!eventRun && parentNode != $('select#t_comprobacion').val()){
$.getJSON("/gastos/ajax/json_tipos/"+$(this).val(), function(j){
"""
http://www.blog.pythonlibrary.org/?p=18
http://wiki.wxpython.org/Transparent%20Frames
"""
import wx
class Fader(wx.Frame):
def __init__(self):
"""
Disabled button
"""
wx.Frame.__init__(self, parent, id, style=wx.DEFAULT_FRAME_STYLE ^(wx.MAXIMIZE_BOX))
GIT TIPS
CONFIG
git config --global user.name "Jair Gaxiola"
git config --global user.email jyr.gaxiola@gmail.com
CREAR REPOSITORIO
- mkdir popcorn-wrapper
- cd popcorn-wrapper
- git init
Instalar mysqldb
* Descargar mysqldb y hacer lo propio.
* Ubicar el path de mysql_config y cambiarlo en setup_posfix.py en la variable mysql_path
* Es necesario tener gcc, en caso de no tenerlo instalarlo desde los ports
port install gcc43
* editar _mysql.c para borrar las lineas 37-39:
@jyr
jyr / gist:139645
Created July 2, 2009 18:59
Rich Text Toolbar for html
#!/usr/bin/env python
# -*- coding: us-ascii -*-
# generated by wxGlade 0.6.3 on Wed Jun 24 01:20:43 2009
import wx
import wx.richtext as rt
import wx.html as html
import urllib
from cStringIO import StringIO
import os
@jyr
jyr / gist:154434
Created July 24, 2009 17:42
Hack for get dashboard of tumblr
def dashboard(self):
self.domain = 'http://www.tumblr.com'
self.url = self.domain + '/login'
self.params = urlencode({'email':self.email, 'password': self.password})
self.headers = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"}
self.response = self._getcookie(self.domain, self.url, self.headers, self.params)
self.cookie = self._cookie(self.response)
self.response = self._getcookie(self.domain, self.url, self.headers, self.params, self.cookie)
#
# Copyright (c) 2009 Foresight Linux
# This file is distributed under the terms of the MIT License.
# A copy is available at http://www.rpath.com/permanent/mit-license.html
#
class OpentumblrClient(PackageRecipe):
name = 'opentumblr-client'
version = '0.0.5'