This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<meta name="color:Background" content="#000"/> | |
<meta name="color:Title" content="#444"/> | |
<meta name="color:Description" content="#777"/> | |
<meta name="color:Post Title" content="#6498cc"/> | |
<meta name="color:Text" content="#444"/> | |
<meta name="color:Inline Link" content="#6498cc"/> | |
<meta name="color:Quote" content="#888"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<meta http-equiv="content-type" content="text/html;charset=UTF-8" /> | |
<style> | |
.tweet { | |
background-color:#dfdfdf; | |
padding:5px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
$('input.default').each(function(){ | |
input = $(this); | |
input.data("val", input.val()); | |
input.click(function(){ | |
input = $(this); | |
if(input.val() == input.data("val")) { | |
input.val(""); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""FOR FUNNS ONLY!!! :)""" | |
from simplejson import loads | |
from urllib import urlopen, quote | |
from time import sleep | |
from string import rjust | |
from sys import argv | |
url = 'http://search.twitter.com/search.json' | |
if len(argv)< 2: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xml.etree.ElementTree as etree | |
#<doc> | |
# <nimi>NIMI</nimi> | |
# <subb> | |
# <teineSub>wohoo</teineSub> | |
# </subb> | |
#</doc> | |
tree = etree.parse('xml.xml') | |
root = tree.getroot() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Number.prototype.formatMoney = function(c, d, t){ | |
var n = this, c = isNaN(c = Math.abs(c)) ? 2 : c, d = d == undefined ? "," : d, t = t == undefined ? "." : t, s = n < 0 ? "-" : "", i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", j = (j = i.length) > 3 ? j % 3 : 0; | |
return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : ""); | |
}; | |
document.write((123456.78).formatMoney(2, ',', ' ')) //123 456,78 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = """ | |
tekst | |
%s | |
tekst | |
%s | |
""" % (1,2) | |
#or | |
a = """ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
limit_arguments = { | |
'peer-limit': int(config.get('peer-limit', 30)), | |
'uploadLimit': int(config.get('uploadLimit', 25)), | |
'uploadLimited': [False,True][int(config.get('uploadLimit', 25)) > 0], | |
'seedRatioLimit':float(config.get('seedRatioLimit', 1.5)), | |
'seedRatioMode':[0,1][float(config.get('seedRatioLimit', 1.5)) > 0], | |
'seedRatioLimited':[False,True][float(config.get('seedRatioLimit', 1.5)) > 0], | |
'ids':[] | |
} | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
#Nii funkab ka | |
def get_filename(value): | |
if isinstance(value, basestring): | |
i = max(value.rfind('/'), value.rfind('\\')) | |
if i > 0: | |
value = value[i+1:] | |
return value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
class myTest(unittest.TestCase): | |
def testTest(self): | |
self.assertTrue(True) | |
self.assertFalse(False) | |
self.assertEquals(1,1) | |
tests = unittest.TestSuite() | |
tests.addTest(unittest.makeSuite(myTest)) |
OlderNewer