This file contains hidden or 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
extern crate futures; | |
use std::io::{self, BufRead}; | |
use std::thread; | |
use futures::{Future, Sink, Stream}; | |
use futures::stream::BoxStream; | |
use futures::sync::mpsc::channel; | |
fn stdin() -> impl Stream<String, io::Error> { |
This file contains hidden or 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
#include <mapbox/variant.hpp> | |
#include <cstdlib> | |
#include <iostream> | |
struct A { | |
int x = 0; | |
}; | |
struct B { |
This file contains hidden or 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
### Keybase proof | |
I hereby claim: | |
* I am boxdot on github. | |
* I am boxdot (https://keybase.io/boxdot) on keybase. | |
* I have a public key ASA3uOn3iwMZiWKugu5uWg99hm4BWMw3PqUMYmI28KULDAo | |
To claim this, I am signing this object: |
This file contains hidden or 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
#include <iostream> | |
template<typename... Fn> | |
struct overload; | |
template<typename F, typename... Fn> | |
struct overload<F, Fn...> : F, public overload<Fn...>::type | |
{ | |
using type = overload; |
This file contains hidden or 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
#include <boost/asio.hpp> | |
#include <thread> | |
#include <iostream> | |
int main(int argc, char const *argv[]) | |
{ | |
boost::asio::io_service service; | |
boost::asio::io_service::work work(service); | |
std::thread thread([&service](){ service.run(); }); |
This file contains hidden or 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
license: MIT | |
height: 500 |
This file contains hidden or 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
// Compile with: | |
// c++ -std=c++11 socket.cpp -o socket | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <unistd.h> | |
#include <vector> | |
#include <iostream> |
This file contains hidden or 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
// Compile with: c++ -std=c++1y -stdlib=libc++ -pthread thread_loc.cpp | |
#include <thread> | |
#include <future> | |
#include <iostream> | |
#include <mutex> | |
namespace { |
This file contains hidden or 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
# openssl req -nodes -x509 -new -keyout server.key -out server.crt | |
# brew install openssl | |
# pip install pyOpenSSL | |
from flask import Flask | |
app = Flask(__name__) | |
@app.route('/') |
This file contains hidden or 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
import requests | |
from flask import Flask, request | |
from chatterbot import ChatBot | |
app = Flask(__name__) | |
TOKEN = "PUT YOUR TOKEN STRING HERE" |