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
#!/usr/bin/env python | |
import simplejson | |
import logging | |
import random | |
import re | |
import datetime | |
import string | |
import time | |
import sys |
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
#!/usr/bin/env python | |
import simplejson | |
import logging | |
import random | |
import re | |
import datetime | |
import string | |
import time | |
import sys | |
import urllib |
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://openshift.redhat.com/community/blogs/enabling-python-27-on-a-paas-with-the-openshift-diy-app-type | |
https://openshift.redhat.com/community/blogs/a-paas-that-runs-anything-http-getting-started-with-diy-applications-on-openshift | |
Enabling Python 2.7 on a PaaS with the OpenShift DIY App Type | |
Thursday, May 17, 2012 | |
by Evan Hazlett | |
Developer - Hacker | |
Preface | |
I have been using OpenShift for a few months now and have to say that I still love it. I've sampled most of the other PaaS solutions and feel most comfortable with OpenShift. One of the features I enjoy most in the service is the "do-it-yourself" application. With this, you can run just about anything in a "minimal-hassle", scalable environment. |
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 flask import Flask | |
import platform | |
from flask import Request, Response | |
from werkzeug.routing import BaseConverter | |
import time | |
import sys | |
import json | |
import urllib2 |
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
#!/usr/bin/env python | |
import time | |
import sys | |
import os | |
import json | |
from flask import Flask, Request, Response | |
from werkzeug.routing import BaseConverter | |
import urllib2 |
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
TCHAR bufferWill[512]; | |
_stprintf(bufferWill, TEXT(" ## [%s] BEGIN ##L%d\n"), __FUNCTION__, | |
,__LINE__); | |
::OutputDebugString(bufferWill); | |
// OLE2W(message) | |
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
# Original code by Dan Brotherston | |
import sys | |
import mmap | |
import struct | |
import win32event | |
import thread | |
import time | |
def OutputDebug(threadName, delay): | |
buffer_ready = win32event.CreateEvent(None, 0, 0, "DBWIN_BUFFER_READY") |
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
pcall(require,"socket") | |
Scheduler = setmetatable({}, { | |
__call = function(class) | |
return setmetatable({ | |
threads = {}, | |
}, class) | |
end | |
}) | |
Scheduler.__index = Scheduler |
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
require "socket" | |
function download (host, file, port) | |
port = port or 80 | |
print (host, file, port) | |
local connectStatus, myConnection = pcall (socket.connect,host,port) | |
if (connectStatus) then | |
myConnection:settimeout(0.01) -- do not block you can play with this value | |
local count = 0 -- counts number of bytes read | |
-- May be easier to do this LuaSocket's HTTP functions |
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
-- cothread.lua | |
local co = coroutine | |
local error = error | |
local setmetatable = setmetatable | |
local unpack = unpack | |
local assert = assert | |
local type = type | |
local pairs = pairs | |