Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.
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 <stdlib.h> | |
#include <stdbool.h> | |
#include <stddef.h> | |
#define _WITH_GETLINE | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <ctype.h> | |
#include <inttypes.h> | |
#include <assert.h> |
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
from django.core.cache import cache | |
from django.core.cache.backends.base import DEFAULT_TIMEOUT | |
from django.db import connection , transaction | |
from hashlib import md5 | |
def cache_chained_calculation(characteristic_str, calculate_function, timeout=DEFAULT_TIMEOUT, force_update=False): | |
""" | |
Attempt to obtain result of @calculate_function, represented by @characteristic_str, through cache or calling the | |
function. Should only allow one caller to be calculating the value at once (enforced using postgres advisory locks), |
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
;;;; metal/compiler.lisp | |
;;;; | |
;;;; Copyright (c) 2015 Adrian Medina | |
(in-package :metal) | |
(defparameter *metal-source-paths* | |
(asdf:system-relative-pathname *system* "src/metal/")) | |
(defun metal (pathname) |
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
#!/bin/sh | |
# Copyright (C) Pierre d'Herbemont, 2010 | |
# Copyright (C) Felix Paul Kühne, 2012-2015 | |
set -e | |
BUILD_DEVICE=yes | |
BUILD_SIMULATOR=yes | |
BUILD_STATIC_FRAMEWORK=no | |
BUILD_STATIC_FRAMEWORK_TV=no |
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
;; setup db to test with | |
;; note that this setup uses a local dev transactor | |
;; you can use a different transactor, but you cannot | |
;; use a mem db because it does not support the log API | |
(require '[datomic.api :as d]) | |
(def uri "datomic:dev://localhost:4334/reified-txes") | |
(d/delete-database uri) | |
(d/create-database uri) | |
(def conn (d/connect uri)) |
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
// ImGui - standalone example application for Glfw + OpenGL 3, using programmable pipeline | |
#include <imgui.h> | |
#include "imgui_impl_glfw_gl3.h" | |
#include <stdio.h> | |
#include <GL/gl3w.h> | |
#include <GLFW/glfw3.h> | |
#include <math.h> | |
#include <string.h> | |
#include <vector> |
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
// Creating a node graph editor for Dear ImGui | |
// Quick sample, not production code! | |
// This is quick demo I crafted in a few hours in 2015 showcasing how to use Dear ImGui to create custom stuff, | |
// which ended up feeding a thread full of better experiments. | |
// See https://github.com/ocornut/imgui/issues/306 for details | |
// Fast forward to 2023, see e.g. https://github.com/ocornut/imgui/wiki/Useful-Extensions#node-editors | |
// Changelog | |
// - v0.05 (2023-03): fixed for renamed api: AddBezierCurve()->AddBezierCubic(). |
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
#!/bin/bash | |
replacements=( | |
"NanAsyncWorker/Nan::AsyncWorker" | |
"NanAsyncQueueWorker/Nan::AsyncQueueWorker" | |
"NanCallback/Nan::Callback" | |
"NanSetInternalFieldPointer/Nan::SetInternalFieldPointer" | |
"NanGetInternalFieldPointer/Nan::GetInternalFieldPointer" | |
"NanNewBufferHandle\\(([^;]+);/Nan::NewBuffer(\\1.ToLocalChecked();" | |
"(NanNew(<(v8::)?String>)?\\(\"[^\"]*\"\\))/\\1.ToLocalChecked()" |
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
#!/bin/bash | |
V4_PRIVATE_IP=`curl http://169.254.169.254/current/meta-data/local-ipv4` | |
V4_PUBLIC_IP=`curl http://169.254.169.254/current/meta-data/public-ipv4` | |
cat > "cloud-config.yaml" <<EOF | |
#cloud-config | |
ssh_authorized_keys: | |
- ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEApv0BQSB1G1TsjKsvzREQfOjv0d+a8hHojk0oJ5B/Aue7Swp0rUN8JViAd91OSGUdAkwy3A/hJ4PoumnwrQlQTGK+JZto7kWONsPSzaBe0SJldOFXdJdiY71ZsT/CIsZgosA2dzDYuUZlo3i9FWTlmg71bJu2JnHq5Z5cWXLV7syPXLvIDcrOzCwUOHWxolYWFUdQPY6w44eg6VhYq+Q3V9Q1NCls0OuLe+k/AjsE6udoFmJai3RHnEVZPNiZz+jKtZXgbsPbH8BSlc1LauRXJBviKU9WF1OXot0FTfRP2H958R9fKvCS5kIOACtFGZUISnYHGH85nnpTNkILICsSlw== | |
write_files: |