Skip to content

Instantly share code, notes, and snippets.

@johnmap
johnmap / papajohns.rb
Created April 17, 2016 14:26 — forked from johnhamelink/papajohns.rb
Ruby CLI Client for Papa Johns' API
require 'rubygems'
require 'bundler/setup'
require 'faraday'
require 'pry'
require 'json'
@conn = Faraday.new(url: 'https://api.papajohns.co.uk') do |faraday|
faraday.adapter Faraday.default_adapter
end
@mywaiting
mywaiting / graceful_shutdown_tornado_web_server.py
Last active May 7, 2022 08:30
The example to how to shutdown tornado web server gracefully...
#!/usr/bin/env python
"""
How to use it:
1. Just `kill -2 PROCESS_ID` or `kill -15 PROCESS_ID` , The Tornado Web Server Will shutdown after process all the request.
2. When you run it behind Nginx, it can graceful reboot your production server.
3. Nice Print in http://weibo.com/1682780325/zgkb7g8k7
"""