Skip to content

Instantly share code, notes, and snippets.

View nekko1119's full-sized avatar
🍙
nano!

nekko1119 nekko1119

🍙
nano!
View GitHub Profile
@nekko1119
nekko1119 / dns.cpp
Last active June 2, 2024 20:04
simple dns request and parse response
#include <WS2tcpip.h>
#include <WinSock2.h>
#include <algorithm>
#include <cstdint>
#include <cstdlib>
#include <iostream>
#include <iomanip>
#include <string_view>
#include <sstream>
#include <variant>
#include <memory>
#include <stdexcept>
#include <iostream>
template <typename T, typename E = std::exception>
struct result {
using value_type = T;
using error_type = std::shared_ptr<E>;
#include <DxLib.h>
#include <experimental/generator>
class App {
char input[256];
public:
std::experimental::generator<int> update() {
while (ProcessMessage() == 0) {
GetHitKeyStateAll(this->input);
ClearDrawScreen();

初期曲

Brand New Theater!
THE IDOLM@STER
ココロがかえる場所
Blue Symphony
Sentimental Venus
Marionetteは眠らない
#include <DxLib.h>
#include <rx.hpp>
class Input {
char input[256];
rxcpp::subjects::subject<int> zInput;
public:
void update() {
GetHitKeyStateAll(this->input);
@nekko1119
nekko1119 / winhttp_async_get.cpp
Last active May 8, 2017 19:00
WinAPIの通信
//WinHttpでHTTP通信を行う
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <winhttp.h>
#include <iostream>
#include <sstream>
#include <vector>
#pragma comment(lib, "Winhttp.lib")
#include <iostream>
#include <regex>
#include <string>
#include <sstream>
#include <vector>
std::vector<std::string> split(std::string const& target, std::regex const& pattern)
{
std::sregex_token_iterator first{target.begin(), target.end(), pattern, -1};
std::sregex_token_iterator last;
#include <codecvt>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <locale>
#include <string>
#include <system_error>
#include <vector>
#include <Windows.h>
#include <iostream>
#include <string>
struct unit_t {} unit = {};
template <typename T>
auto putStrLn(T const& value) {
return [&]() {
std::cout << value << std::endl;
return unit;
#include <winerror.h>
#include <system_error>
#include <iostream>
#include <string>
int main()
{
std::system("chcp 932");
std::error_code ec{ERROR_FILE_EXISTS, std::system_category()};
std::system_error se{ec};