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
>>> abc = {} | |
>>> for k, v in resp.cookies.items(): | |
... if k in abc: | |
... abc[k].append(v) | |
... else: | |
... abc[k] = [v] | |
... | |
>>> abc | |
{'statid': ['32dbb464d0bc217e5580f05bce4ca632:c5b35d:1400098838:v3', '32dbb464d0bc217e5580f05bce4ca632:c5b35d:1400098838:v3'], 'reksticket': ['1400098838'], 'rekticket': ['1400098838']} |
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
<link rel="import" href="../bower_components/core-collapse/core-collapse.html"> | |
<polymer-element name="my-collapse"> | |
<template> | |
<button on-click="{{toggle}}">Click me</button> | |
<core-collapse id="collapse"> | |
Hello world! | |
</core-collapse> | |
</template> |
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
Uncaught TypeError: undefined is not a function | |
bundled.js:7638_.each.Events.(anonymous function) | |
bundled.js:5941Marionette.CollectionView.Marionette.View.extend._initialEvents | |
bundled.js:7513(anonymous function) | |
bundled.js:19075_.before | |
bundled.js:7620triggerEvents | |
bundled.js:7561Backbone.Events.trigger | |
bundled.js:4505(anonymous function) | |
bundled.js:5711Marionette.View.Backbone.View.extend.triggerMethod | |
bundled.js:5978Marionette.CollectionView.Marionette.View.extend.render |
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
user, created = User.objects.get_or_create( | |
param1=foo, | |
param2=bar | |
) |
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
-- Logs begin at wto 2012-11-13 01:54:02 CET, end at pią 2015-05-01 15:06:49 CEST. -- | |
maj 01 15:02:35 macbook kernel: Initializing cgroup subsys cpuset | |
maj 01 15:02:35 macbook kernel: Initializing cgroup subsys cpu | |
maj 01 15:02:35 macbook kernel: Initializing cgroup subsys cpuacct | |
maj 01 15:02:35 macbook kernel: Linux version 4.0.1-1-ARCH (builduser@tobias) (gcc version 5.1.0 (GCC) ) #1 SMP PREEMPT Wed Apr 29 12:15:20 CEST 2015 | |
maj 01 15:02:35 macbook kernel: e820: BIOS-provided physical RAM map: | |
maj 01 15:02:35 macbook kernel: BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable | |
maj 01 15:02:35 macbook kernel: BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved | |
maj 01 15:02:35 macbook kernel: BIOS-e820: [mem 0x00000000000e0000-0x00000000000fffff] reserved | |
maj 01 15:02:35 macbook kernel: BIOS-e820: [mem 0x0000000000100000-0x000000003e0f5fff] usable |
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
print sum([1 for number in open('tel.txt').readlines() if number[0:3] == '511']) | |
# 100 loops, best of 3: 1.65 ms per loop |
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
In [15]: import re | |
In [16]: pattern = re.compile('\(.*\)') | |
In [17]: %timeit pattern.search(string) | |
1000000 loops, best of 3: 1.04 µs per loop | |
In [18]: %timeit '(' in string and ')' in string | |
1000000 loops, best of 3: 260 ns per loop |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import irssi | |
import feedparser | |
username = 'pagenoare' | |
p_title = '' | |
def checker(): |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import re | |
import random | |
import urllib2 | |
from urllib import urlencode | |
import irssi |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import irssi | |
import feedparser | |
username = 'pagenoare' | |
def nowplaying(data, server, witem): | |
d = feedparser.parse('http://ws.audioscrobbler.com/2.0/user/%s/recenttracks.rss' % username) |
OlderNewer