Skip to content

Instantly share code, notes, and snippets.

View lqc's full-sized avatar

Łukasz Rekucki lqc

  • Syncron
  • Warsaw, Poland
View GitHub Profile
@lqc
lqc / gist:275264
Created January 12, 2010 15:07 — forked from ryszard/gist:275260
>>> 'ala ma kota'.replace(' ', r'\ ')
'ala\\ ma\\ kota'
>>> list('ala ma kota'.replace(' ', r'\ '))
['a', 'l', 'a', '\\', ' ', 'm', 'a', '\\', ' ', 'k', 'o', 't', 'a']
>>> print('ala ma kota'.replace(' ', r'\ '))
ala\ ma\ kota
def bRun(val, name, bf, res, bfpt, info, mlt, pr, nr = {0:1}, check = False):
solutions = {}
new, cz = runF(val, name, bf, res, check)
solt = oneTab(new)
lst = nr.keys()[-1]
last = glMulti(nr)
if solt["e"] > 0 and last < mlt:
m = 1
solutions[lst] = {"data" : solt, 'mlt' : last}
tmp = newName(name, nr, True)
from lxml import etree
DOC = """<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl">
<head>
<title>{}</title>
</head>
<body>
<ul id="menu"></ul>
<ul xml:id="posty"></ul>
</body>
<html>
<head>
<title>Webkit Bug</title>
<meta http-equiv="Content-Type" value="text/html; charset=utf-8">
</head>
<body>
<p>Hello World!</p>
<script type="text/javascript">
function run()
# -*- coding: utf-8
from xml.dom import minidom
from urllib import urlopen
from os import getcwd
import codecs
class HackingRssReader:
def __init__(self, feed_url = 'http://hacking.pl/rss.xml' ):
self.feed_url = feed_url# nie ma powodu tego ukrywać
#! /usr/bin/env python
#-*- coding: utf-8 -*-
"""
Source: http://forum.python.org.pl/index.php?topic=1607.msg7913#msg7913
"""
import socket
import sys
import os
import datetime
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Bleach Exile &gt; Online Manga Reader &gt; Browse Series</title>
</head>
<body>
<script language="JavaScript" type="text/javascript">
document.write('<scr'+'ipt language="JavaScript" src="http://ad.de.doubleclick.net/adj/P4444.ani.animemanga.de_de/Value;sz=728x90;tile=1;dcopt=ist;ord='+ord+'?" type="text/javascript"></scr'+'ipt>');
</script>
</body>
import functools
import datetime
def with_time(func):
@functools.wraps(func)
def timed_execution(*args, **kwargs):
start = datetime.datetime.now()
try:
result = func(*args, **kwargs)
time = datetime.datetime.now() - start
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
.click {
background: white;
opacity: 0.5;
}
SELECT DISTINCT people.*, count(my_friends.guid_two) AS coincidence
FROM entities people
LEFT JOIN metadata
ON (metadata.entity_guid = people.guid)
LEFT JOIN relationships related_friends
ON (related_friends.guid_two = people.guid)
LEFT JOIN relationships my_friends
ON (related_friends.guid_one = my_friends.guid_two)
WHERE my_friends.guid_one = 'ME!' -- indirectly related to me
AND my_friends.relation = 'friend'