Skip to content

Instantly share code, notes, and snippets.

@notsobad
notsobad / api_sev.py
Last active February 5, 2022 15:29
Tornado basic auth example
# -*- coding= utf-8 -*-
import datetime
import os
import json
import tornado.ioloop
import tornado.web
import tornado
import tornado.httpclient
import traceback
import urllib2
@avakar
avakar / fixup_qt_msvc.py
Last active April 28, 2018 13:14
The script will recursively walk a directory and modify all .vcxproj.filter files so that the filters reflect the filesystem structure. It will also update .sln files so that they would open in msvc11, and update .vcxproj files so that Debug configurations would have optimizations disabled. I use the script after generating msvc projects from Qt…
import sys, os.path
from xml.etree import ElementTree
import xml.dom.minidom
def process_vcxproj_file(fname):
with open(fname, 'rb') as fin:
proj = fin.read()
add_optimize_after = ' <ItemDefinitionGroup Condition="&apos;$(Configuration)|$(Platform)&apos;==&apos;Debug|Win32&apos;">\r\n <ClCompile>'
proj = proj.replace(add_optimize_after, add_optimize_after + '\r\n <Optimization>Disabled</Optimization>')
@clemensg
clemensg / curl_multi_test.c
Last active June 28, 2023 06:51
libcurl multi interface example
/* curl_multi_test.c
Clemens Gruber, 2013
<[email protected]>
Code description:
Requests 4 Web pages via the CURL multi interface
and checks if the HTTP status code is 200.
Update: Fixed! The check for !numfds was the problem.
@didip
didip / supervisord-example.conf
Created January 30, 2011 05:10
Example configuration file for supervisord.conf
[unix_http_server]
file=/tmp/supervisor.sock ; path to your socket file
[supervisord]
logfile=/var/log/supervisord/supervisord.log ; supervisord log file
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=error ; info, debug, warn, trace
pidfile=/var/run/supervisord.pid ; pidfile location
nodaemon=false ; run supervisord as a daemon