This file contains hidden or 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 re # import python regexp library | |
| with open("dumpfile.txt", "r") as file: # open the file | |
| lines = file.readlines() # read lines from file | |
| # at first I thought you want to parse even more parameters | |
| # regular expression | |
| pattern = "(?P<date>.*) IP (?P<senderIP>[\.\d]*)\.(?P<senderPort>\d*) \> (?P<reciverIP>[\.\d]*)\.(?P<recieverPort>\d*): Flags \[(?P<flags>.*)\],.*" |
This file contains hidden or 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
| class someForm(ModelForm): | |
| class Meta: | |
| model = someModel | |
| class AnotherForm(forms.Form): | |
| def __init__(self, *args, **kwargs): | |
| super(AnotherForm, self).__init__(*args, **kwargs) | |
| for name, field in someForm().fields.iteritems(): |
This file contains hidden or 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/python3 | |
| # -*- coding: UTF-8 -*- | |
| # @author: Visgean Skeloru | |
| # email: <visgean@gmail.com> | |
| # jabber: <visgean@jabber.org> | |
| # github: http://github.com/Visgean | |
| from http import cookiejar |
This file contains hidden or 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 facebook | |
| import urllib2 | |
| import codecs | |
| print "You need API token: get one here: https://developers.facebook.com/tools/explorer" | |
| USER_ACCESS_TOKEN= raw_input("Your API key: ") |
This file contains hidden or 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 pickle | |
| >>> with open("backup.pkcl", "r") as ffile: | |
| ... threads = pickle.load(ffile) | |
| ... | |
| >>> [thread["thread_id"] for thread in threads if thread["thread_id"]=="XC6AsBE4icQR1NGf6ZCVhw"] | |
This file contains hidden or 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
| //FightCode can only understand your robot | |
| //if its class is called Robot | |
| var Robot = function(robot) { | |
| }; | |
| Robot.prototype.onIdle = function(ev) { | |
| var robot = ev.robot; | |
| robot.ahead(100); |
This file contains hidden or 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
| //FightCode can only understand your robot | |
| //if its class is called Robot | |
| var Robot = function(robot) { | |
| }; | |
| Robot.prototype.onIdle = function(ev) { | |
| var robot = ev.robot; | |
| robot.ahead(100); |
This file contains hidden or 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
| [ | |
| { | |
| 'speaker': '1st Prop', | |
| 'speaker_full': '1st Proposition speaker', | |
| 'speech_length': 8*60, | |
| 'events' :[ | |
| { | |
| 'name':'Points forbidden', // this will be used as subtitle | |
| 'start_time': 0, // when this event happens before end? | |
| 'duration': 60, // how long is it going to last? |
This file contains hidden or 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
| class SpotifyAPI(): | |
| def __init__(self, login_callback_func=False): | |
| self.auth_server = "play.spotify.com" | |
| self.logged_in_marker = Event() | |
| self.heartbeat_marker = Event() | |
| self.username = None | |
| self.password = None | |
| self.account_type = None | |
| self.country = None |
This file contains hidden or 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
| def authenticate | |
| if request.post? | |
| if params[:password] == 'sbk6JQ5wKCHr' | |
| session[:authenticated] = true | |
| respond_to do |format| | |
| format.json { head :ok } | |
| end | |
| else | |
| respond_to do |format| |