Skip to content

Instantly share code, notes, and snippets.

View ronchaine's full-sized avatar

Jari Ronkainen ronchaine

  • Oulu, Finland
View GitHub Profile
@ronchaine
ronchaine / check_host_ip.hpp
Created July 22, 2025 14:39
quick checking for valid hostname / ip address
constexpr bool is_digit(char32_t c) noexcept {
return c >= '0' && c <= '9';
}
constexpr bool is_alpha(char32_t c) noexcept {
return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z');
}
constexpr bool is_alphanum(char32_t c) noexcept {
return is_digit(c) || is_alpha(c);
#include <iostream>
#include <cmath>
#include <future>
#include <chrono>
struct Moon
{
int pos = 0;
int vel = 0;
};
@ronchaine
ronchaine / example.flow
Last active October 18, 2019 14:10
flow example
# syntax stuff
# declare type kind
deftype Integer as
{
int8 or
int16 or
int32 or
int64 or
int128 or
@ronchaine
ronchaine / ecs.cpp
Created July 11, 2016 13:12
Quick draft for entity-component system.
#include <vector>
#include <unordered_map>
#include <set>
#include <memory>
#include <iostream>
#include <type_traits>
#include <atomic>
#include <cassert>
@ronchaine
ronchaine / arguments.hpp
Created May 26, 2016 00:37
Easier way to parse command line arguments with c++
#include <string>
#include <cstring>
#include <vector>
#include <unordered_map>
#include <tuple>
#include <iostream>
#include <iomanip>
@ronchaine
ronchaine / getuchar()
Created March 27, 2014 23:06
reading unicode characters from standard input.
char32_t getuchar()
{
int inp = getchar();
if (inp == EOF)
return 0;
if (!(inp & 0x80))
return (char32_t)inp;
@ronchaine
ronchaine / steam_dota2_crash_sysspecs
Created November 15, 2013 07:00
System information from steam during Three Spirits patch.
Processor Information:
Vendor: AuthenticAMD
CPU Family: 0x15
CPU Model: 0x2
CPU Stepping: 0x0
CPU Type: 0x0
Speed: 4000 Mhz
8 logical processors
8 physical processors
HyperThreading: Unsupported