This file contains 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
#! /usr/bin/env python3 | |
import asyncio | |
import json | |
import sys | |
import yaml | |
def main(args=None): |
This file contains 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
/* http://l3net.wordpress.com/2012/12/09/a-simple-telnet-client/ */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <arpa/inet.h> | |
#include <termios.h> | |
#include <fcntl.h> | |
This file contains 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
#192.168.1.100 ddld.loc.al | |
#127.0.0.1 ddld.loc.al | |
#127.0.0.1 www.gstatic.com | |
127.0.0.1 www.google-analytics.com | |
127.0.0.1 www.googletagmanager.com | |
#127.0.0.1 www.googleadservices.com | |
#127.0.0.1 ade.googlesyndication.com | |
#127.0.0.1 tpc.googlesyndication.com | |
#127.0.0.1 pagead2.googlesyndication.com | |
#127.0.0.1 securepubads.g.doubleclick.net |
This file contains 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/any.hpp> | |
#include <boost/spirit/include/qi.hpp> | |
#include <boost/fusion/include/std_pair.hpp> | |
#include <vector> | |
#include <map> | |
#include <iostream> | |
namespace json { |
This file contains 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
#! /usr/bin/env python3 | |
import asyncio | |
from concurrent.futures import ThreadPoolExecutor | |
import requests | |
import sys | |
def background_task(): | |
rv = requests.get('https://httpbin.org/get') |
This file contains 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
std::vector<std::string> findSubstrings(std::vector<std::string> words, std::vector<std::string> parts) { | |
sort(begin(parts), end(parts), [](const std::string & a, const std::string & b) -> bool { | |
return a.size() > b.size(); | |
}); | |
for (int i = 0; i < words.size(); ++i) { | |
words[i] = highlight(words[i], parts); | |
} | |
return words; | |
} |
This file contains 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
#! /usr/bin/env python | |
import cookielib | |
import sys | |
import urllib | |
from BeautifulSoup import BeautifulSoup | |
import mechanize | |
This file contains 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
cmake_minimum_required(VERSION 2.8) | |
find_package(Qt5Core REQUIRED) | |
find_package(Qt5Network REQUIRED) | |
set(CMAKE_AUTOMOC ON) | |
find_package(Boost REQUIRED COMPONENTS coroutine system context) | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") | |
set(SOURCES "src/main.cpp" "src/task.cpp" "src/task.hpp" "src/task_p.hpp" "src/httpserver.cpp" "src/httpserver.hpp") |
This file contains 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
#! /usr/bin/env python3 | |
import asyncio | |
import contextlib | |
async def ping(ip): | |
p = await asyncio.create_subprocess_exec('ping', '-c', '4', ip, stdout=asyncio.subprocess.PIPE) | |
async for line in p.stdout: | |
print(line) |
This file contains 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 <stdio.h> | |
#include <pthread.h> | |
void * worker (void * o) { | |
int * p = NULL; | |
printf("%d\n", *p); | |
return NULL; | |
} |
NewerOlder