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 random | |
class Sensor(object): | |
OFFSET = 16 | |
def pop_next_pressure_psi_value(self): | |
pressure_telemetry_value = self.sample_pressure() | |
return Sensor.OFFSET + pressure_telemetry_value | |
def __iter__(self): |
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
data Story = Snippet String Story Story | |
| End |
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
# COMMAND PROMPT ENVIRONMENT | |
python -c "import urllib.request;open('distribute_setup.py', 'wb').write(urllib.request.urlopen('http://python-distribute.org/distribute_setup.py').read())" | |
python distribute_setup.py | |
python -c "import urllib.request;open('get-pip.py', 'wb').write(urllib.request.urlopen('https://raw.github.com/pypa/pip/master/contrib/get-pip.py').read())" | |
python get-pip.py | |
# GIT-MSYS ENVIRONMENT | |
curl -O http://python-distribute.org/distribute_setup.py | |
python distribute_setup.py |
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
# hitta element baserat på id | |
elem = driver.find_element_by_id('some-id') | |
# hitta element baserat på class | |
elem = driver.find_element_by_xpath("//*[contains(@class, 'some-class')]") | |
# hitta element baserat på del-av-id | |
elem = driver.find_element_by_xpath("//*[contains(@id,'some-id-substring')]") | |
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
def dirt(module, substring=''): print('\n'.join((d for d in dir(module) if substring in d))) | |
Usage: | |
$ python | |
Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600 32 bit (Intel)] on win32 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> def dirt(module, substring=''): print('\n'.join((d for d in dir(module) if substring in d))) | |
... | |
>>> import os.path |
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 multiprocessing | |
import time | |
from browserdriver import BrowserDriver | |
def readfile(fname): | |
with open(fname) as f: | |
content = f.read() | |
#print("Read value " + content + " from file " + fname) | |
return content |
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
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4E9CFF4E | |
sudo sh -c 'echo "deb http://repository.spotify.com stable non-free" >> /etc/apt/sources.list' | |
sudo apt-get update && sudo apt-get install spotify-client-qt |
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
sudo apt-get update | |
sudo apt-get upgrade -y | |
sudo apt-get install adobe-flashplugin | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4E9CFF4E | |
sudo sh -c 'echo "deb http://repository.spotify.com stable non-free" >> /etc/apt/sources.list' | |
sudo apt-get update && sudo apt-get install spotify-client-qt -y --force-yes | |
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
<html> | |
<head> | |
<title>Poor mans digital sign</title> | |
<meta http-equiv="content-type" content="text/html;charset=utf-8" /> | |
<script> | |
var urls = [ | |
'http://www.bloggar.se', | |
'http://www.knuff.se', |
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-US" lang="en-US"> | |
<head> | |
<title>Start page</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<style type="text/css"> |
OlderNewer