Эта фраза запатентована Даниилом Поповым
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 | |
response = requests.get('http://url.com') | |
for resp in response.history: | |
print(f'{resp.status_code} {resp.url}') | |
print(f'{resp.status_code} {resp.url}') | |
print(f'{response.status_code} {response.url}') | |
print(response.headers) |
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
# https://pypi.org/project/tornado-http-auth/ | |
import tornado.ioloop | |
from tornado.web import RequestHandler, Application | |
from tornado_http_auth import DigestAuthMixin, BasicAuthMixin, auth_required | |
credentials = {'user1': 'pass1'} | |
# Example 1 (using decorator). | |
class MainHandler(DigestAuthMixin, RequestHandler): |
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 WatchKit | |
import Foundation | |
class GameController: WKInterfaceController, WKCrownDelegate { | |
// Add SpriteKit outlet here | |
@IBOutlet weak var skInterface: WKInterfaceSKScene! | |
var gameScene:GameScene! |
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 WatchKit | |
import Foundation | |
class InterfaceController: WKInterfaceController, WKCrownDelegate { | |
@IBOutlet var skInterface: WKInterfaceSKScene! | |
override func awake(withContext context: Any?) { | |
super.awake(withContext: context) |
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 UIKit | |
import SpriteKit | |
class gameScene: SKScene { | |
var background = SKSpriteNode(imageNamed: "bgimage") | |
override func sceneDidLoad(view: SKView) { | |
background.position = CGPoint(x: frame.size.width / 2, y: frame.size.height / 2) | |
background.zPosition = -1; | |
addChild(background) |
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
class Button(object): | |
html = "" | |
def get_html(self): | |
return self.html | |
class Image(Button): | |
html = "<img></img>" |
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
for (var i=0; i < 101; i++){ | |
if (i % 15 == 0) console.log("FizzBuzz"); | |
else if (i % 3 == 0) console.log("Buzz"); | |
else if if (i % 5 == 0) console.log("Fizz"); | |
else console.log(i); | |
} |
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
const http = require('http'); | |
const link = 'http://387338.xyz:8000/status-json.xsl' | |
http.get(link, (resp) => { | |
let data = ''; | |
// A chunk of data has been recieved. | |
resp.on('data', (chunk) => { | |
data += chunk; | |
}); |
NewerOlder