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 requests | |
class RequestsTest(requests.Session): | |
def __init__(self): | |
super().__init__() | |
self.headers["accept"] = "application/json" | |
self.params["your_api_key_here"] = "my_api_key" | |
def get_with_params(self, params): |
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
[program:owfs] | |
# - run as root (user=root) | |
# - allow other users to access owfs mount (--allow_other) | |
# - scan all USB adapters (-uall) | |
# - mount to /mnt/owfs | |
command = /usr/bin/owfs --allow_other --foreground -uall /mnt/owfs | |
user=root |
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="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-menu/core-submenu.html"> | |
<polymer-element name="my-element"> |
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="../core-drawer-panel/core-drawer-panel.html"> | |
<link rel="import" href="../core-menu/core-submenu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; |
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
### Keybase proof | |
I hereby claim: | |
* I am ojarva on github. | |
* I am ojarva (https://keybase.io/ojarva) on keybase. | |
* I have a public key whose fingerprint is 4EF2 FDB8 21A5 579D 581C 061E 3586 B610 0A9D 393B | |
To claim this, I am signing this object: |
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
from oauth2client.client import flow_from_clientsecrets | |
from oauth2client.client import OAuth2WebServerFlow | |
from oauth2client.file import Storage | |
storage = Storage('a_credentials_file') | |
credentials = storage.get() | |
if not credentials: | |
flow = flow_from_clientsecrets('client_secrets.json', | |
scope='https://www.googleapis.com/auth/admin.reports.audit.readonly', | |
redirect_uri='urn:ietf:wg:oauth:2.0:oob') |
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 | |
def worker(parameter): | |
worker.queue.put("foo") | |
def worker_init(queue): | |
worker.queue = queue | |
queue = multiprocessing.Queue() | |
pool = multiprocessing.Pool(MAX_THREADS, worker_init, [queue]) |