Skip to content

Instantly share code, notes, and snippets.

heidmotron /
Last active Apr 9, 2019
Python3 app using cf tasks

Push an app

Push an app with a main web process that runs forever (in this case it does nothing) and there is no healthcheck

Download,, and requirement.txt into a directory. Then from that directory, run:

cf push py-simple -b -c "python"  -u none
View #568
# Existing
action = url_for(:action => options[:action], :id => record)
# action should be the result of url_for which would be a string
# then it gets shoved into a hash where url_for will get called once again
contents = form_tag({:action => action}, :method =>(options[:method] || 'post'), :enctype => options[:multipart] ? 'multipart/form-data': nil)
# The patch
action = {:action => options[:action], :id => record}
View gist:37545
// since it's synchronous it waits till the request is finished before the window closes
window.onbeforeunload = function() {
new Ajax.Request('/', {method: 'get', asynchronous: false})