Skip to content

Instantly share code, notes, and snippets.

Avatar

David Gorski dgski

View GitHub Profile
View signup.js
let request = {
"first_name": first_name,
"last_name": last_name,
"email": email,
"address": JSON.parse(address),
"weight_kg": weight_kg,
"target_weight_kg": target_weight_kg,
"height_cm": height_cm,
"activity_level": activity_level,
"gender": gender,
View compiletime_whitespace_truncate.cpp
#include <iterator>
namespace compiletime {
template<std::size_t MaxSize = 30>
class string
{
char m_data[MaxSize] = { 0 };
std::size_t m_size;
public:
View recursive_data_composition.cpp
#include <iostream>
#include <variant>
#include <vector>
// Forward Declaration
struct Node;
// Simple
using Int = int;
using String = std::string;
View concise_result_extraction.cpp
#include <iostream>
#include <variant>
#include <string>
#include <vector>
#include <tuple>
struct Error {
std::string message;
Error(std::string _message) : message(std::move(_message)) {}
};
View style.css
body {
margin: 0px;
font-size: 12px;
font-family: Arial, Helvetica, sans-serif;
background-color: #263238;
}
.window {
position: absolute;
width: 100%;
View logviewer.html
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="viewer" class="window">
<div class="top-bar">
<div>
<span style="color: red; font-size: 18px;">&#x2606;</span>LOG VIEWER
View tail.cpp
#include <iostream>
#include <fstream>
#include <chrono>
#include <thread>
#include <sstream>
void tail(std::ifstream& f)
{
std::uint64_t lineCount = 0;
auto sleepTime = std::chrono::seconds(0);
View powerOfIterators.cpp
#include <vector>
#include <string>
#include <list>
#include <deque>
#include <iterator>
#include <algorithm>
#include <numeric>
#include <array>
#include <iostream>
View offset.cpp
#include "benchmark.h"
#include <iostream>
#include <fstream>
constexpr auto LENGTH = 10000000;
constexpr auto ITERATIONS = 100;
template<int N>
struct LargeOffset {