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/env python | |
# -*- encoding: utf-8 -*- | |
import unittest | |
import requests | |
import json | |
class Distance(object): | |
def __init__(self): |
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 transaction | |
from AccessControl.SecurityManagement import newSecurityManager | |
from DateTime import DateTime | |
from Testing.makerequest import makerequest | |
app = makerequest(app) | |
newSecurityManager(None, app.acl_users.getUserById('admin')) | |
site = app.plone |
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
request = container.REQUEST | |
response = request.RESPONSE | |
my_file = context.my_content | |
response.setHeader('Pragma', 'no-cache') | |
response.setHeader('Cache-Control', 'max-age=-1,s-maxage=-1, no-cache') | |
response.setHeader('Content-Type', my_file.content_type) | |
return my_file.data |
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/env python | |
import time | |
import hmac | |
import hashlib | |
import base64 | |
import urllib | |
secret_key = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" |
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/env python | |
# -*- coding: utf-8 -*- | |
import unittest | |
def naive_fibonacci(n): | |
'''Simplest recursive implementation''' | |
if n == 0: | |
return 0 |
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/env python | |
#-*- coding: utf-8 -*- | |
from ctypes import Structure, windll, c_uint, sizeof, byref | |
from threading import Thread | |
import time, win32api, win32con | |
class LastInputInfo(Structure): | |
_fields_ = [ |
NewerOlder