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 twisted.internet.protocol import DatagramProtocol | |
from twisted.internet import reactor | |
forwardMap = { | |
5500 : [ "192.168.110.32:5500", "10.0.1.1:5500" ], | |
5499 : [ "192.168.110.32:5499" ], | |
15501 : [ "localhost:5501" ] | |
} |
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> | |
<html lang="en"> | |
<head> | |
<title>WebSocket Client</title> | |
<style> | |
#output { | |
border: solid 1px #000; | |
} | |
</style> | |
</head> |
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
function getXMLHttpRequest() { | |
if ( _root.defined( `XMLHttpRequest ) ) | |
return new XMLHttpRequest(); | |
else { | |
try { | |
return ActiveXObjectFactory.createObject( "MSXML2.XMLHTTP.3.0" ); | |
} catch ( e : Exception ) { | |
return null; | |
} | |
} |
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
(function() | |
{ | |
var global = this; | |
var createXmlHttpRequest = (function() | |
{ | |
var i, | |
fs = [// for legacy eg. IE 5 | |
function() | |
{ |
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 sys | |
from PyQt4 import QtCore, QtGui, QtWebKit | |
import WebGui | |
"""Html snippet.""" | |
html = """ | |
<html><body> | |
<center> | |
<script language="JavaScript"> | |
document.write('<p>Python ' + pyObj.pyVersion + '</p>') |
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
AL = function(type, url, callback) { | |
var el, doc = document; | |
switch(type) { | |
case 'js': | |
el = doc.createElement('script'); | |
el.src = url; | |
break; | |
case 'css': | |
el = doc.createElement('link'); |
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
/* CSS Photo Album */ | |
/* Rebound of this shot by @daryl: http://drbl.in/fwwM */ | |
* { | |
margin: 0; | |
padding: 0; | |
position: relative; | |
box-sizing: border-box; | |
} |
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> | |
<head> | |
<title>Hotkey Demo</title> | |
<script type="text/javascript" src='keymap.js'></script> | |
<script type="text/javascript"> | |
function log(message) { | |
document.getElementById('log').textContent += message + '\n'; | |
} | |
var gui = require('nw.gui'); |
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
// can be used for JSONP calls too | |
var loadScript = function(url, callback) { | |
var script = document.createElement('script'); | |
script.setAttribute('src', url); | |
script.setAttribute("type","text/javascript"); | |
script.setAttribute('async', true); | |
// wait for script to load | |
var onLoaded = function(script,callback) { | |
return function() { | |
// remove the script |
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 socket | |
HOST = 'localhost' | |
PORT = 9876 | |
ADDR = (HOST,PORT) | |
BUFSIZE = 4096 | |
videofile = "videos/royalty-free_footage_wien_18_640x360.mp4" | |
bytes = open(videofile).read() |
OlderNewer