A minimal HTTP server in python. It sends a JSON Hello World for GET requests, and echoes back JSON for POST requests.
python server.py 8009
Starting httpd on port 8009...
curl http://localhost:8009
{"received": "ok", "hello": "world"}
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <title>Ext JS Grid Example</title> | |
| <script src="http://cdn.sencha.io/ext-4.0.7-gpl/ext-all.js"> </script> | |
| <link rel="stylesheet" href="http://cdn.sencha.io/ext-4.0.7-gpl/resources/css/ext-all.css" /> |
| #define BOOST_TEST_MODULE subcommand options | |
| #include <boost/test/unit_test.hpp> | |
| #include <boost/program_options.hpp> | |
| #include <boost/variant/variant.hpp> | |
| #include <boost/variant/get.hpp> | |
| struct GenericOptions { | |
| bool debug_; | |
| }; |
| if(NOT HOME) | |
| if(WIN32) | |
| string(REPLACE "\\" "/" HOME "$ENV{USERPROFILE}") | |
| else() | |
| set(HOME $ENV{HOME}) | |
| endif() | |
| endif() | |
| ### Useful Functions and Macros ### | |
| # Prints a list of messages, each one in a new line |
A minimal HTTP server in python. It sends a JSON Hello World for GET requests, and echoes back JSON for POST requests.
python server.py 8009
Starting httpd on port 8009...
curl http://localhost:8009
{"received": "ok", "hello": "world"}
| .PHONY: using-gcc using-gcc-static using-clang | |
| using-gcc: | |
| g++-4.8 -o main-gcc -lasan -O -g -fsanitize=address -fno-omit-frame-pointer main.cpp && \ | |
| ASAN_OPTIONS=symbolize=1 ASAN_SYMBOLIZER_PATH=$(shell which llvm-symbolizer) ./main-gcc | |
| using-gcc-static: | |
| g++-4.8 -o main-gcc-static -static-libstdc++ -static-libasan -O -g -fsanitize=address -fno-omit-frame-pointer main.cpp && \ | |
| ASAN_OPTIONS=symbolize=1 ASAN_SYMBOLIZER_PATH=$(shell which llvm-symbolizer) ./main-gcc-static |
| // SimpleStringList.h | |
| #ifndef _SIMPLEMODEL_H_ | |
| #define _SIMPLEMODEL_H_ | |
| #include <QtCore> | |
| class SimpleStringModel : public QAbstractListModel | |
| { |
Create the partition:
sgdisk --zap-all /dev/sda
cgdisk /dev/sda
mkfs.ext4 /dev/sda1
mount /dev/sda1 /mntEdit the mirror list to bring the preferred mirror to the top:
| #include <utility> | |
| #include <functional> | |
| #include <type_traits> | |
| #include <typeinfo> | |
| #include <iostream> | |
| namespace meta { | |
| // detects callable objects, not functions |
| #!/bin/bash | |
| # | |
| # Generates client and server certificates used to enable HTTPS | |
| # remote authentication to a Docker daemon. | |
| # | |
| # See http://docs.docker.com/articles/https/ | |
| # | |
| # To start the Docker Daemon: | |
| # | |
| # sudo docker -d \ |
| import signal | |
| import unittest | |
| from time import sleep | |
| class TimeoutException(Exception): | |
| pass | |
| def signal_handler(signum, frame): | |
| raise TimeoutException |