Skip to content

Instantly share code, notes, and snippets.

@J-Vernay
J-Vernay / native_build_proposal.md
Last active November 24, 2020 11:43
(DRAFT) <native_build> proposal

(DRAFT) Proposal for <native_build> in C++23

Abstract

This document proposes an extension of the C++ standard library. This is an informal draft for a proposal: its aim is to get feedback from other C++ users and implementers. Basically, this proposal provides a starting point to use C++ as a basis for C++ build systems. For this, it provides the minimal C++ header <native_build> which is implemented by the compiler maintainers. It defines new types (which are basically strong-typed alias of std::filesystem::path), a new templated function build(...) for building the project, and run(...) for running an executable. It has also a permissive requirement: programs using `` are only required to work on the machine

@IngwiePhoenix
IngwiePhoenix / Value.hpp
Created May 22, 2019 13:34
JerryScript++
#include <string>
#include <vector>
#include "jerryscript.h"
namespace JerryScript {
class Value;
class Undefined;
class Null;
class Boolean;
@Mike-Devel
Mike-Devel / Boostdep.png
Last active November 29, 2019 18:35
Boost dependency graph with cmake coloring
Boostdep.png
@kgantsov
kgantsov / revoke_celery_tasks.py
Created January 2, 2019 11:22
Helper functions that revokes celery tasks by name and ID
from celery.task.control import revoke
from celery.task.control import inspect
def revoke_tasks_by_name(task_name, worker_prefix=''):
"""
Revoke all tasks by the name of the celery task
:param task_name: Name of the celery task
:param worker_prefix: Prefix for the worker
@ictlyh
ictlyh / producer-consumer
Created November 30, 2016 10:55
Producer and consumer demo in concurrent queue. c++ multi-threading.
// concurrent-queue.h
#ifndef CONCURRENT_QUEUE_H_
#define CONCURRENT_QUEUE_H_
#include <queue>
#include <thread>
#include <mutex>
#include <condition_variable>
template <typename T>

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@zmwangx
zmwangx / .gitignore
Last active April 1, 2024 11:36
This program demonstrates how to correctly use openpty(3) from libutil on Linux to execute a command that must be run in a tty, and capture its (arbitrarily long) output.
pty
pty.o
@application2000
application2000 / how-to-install-latest-gcc-on-ubuntu-lts.txt
Last active February 21, 2024 03:02
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
@mik30s
mik30s / webcam_capture.cpp
Last active October 16, 2023 05:06
Simple C++ program to capture a webcam frame in Linux
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <linux/ioctl.h>
#include <linux/types.h>
#include <linux/v4l2-common.h>
#include <linux/v4l2-controls.h>
#include <linux/videodev2.h>
#include <fcntl.h>
#include <unistd.h>
@graphific
graphific / 2_test_gpu_cuda.sh
Last active September 19, 2017 05:01
Test script for checking if Cuda and Drivers correctly installed on Ubuntu 14.04
#!/usr/bin/env bash
# Test script for checking if Cuda and Drivers correctly installed on Ubuntu 14.04, by Roelof Pieters (@graphific)
# BSD License
if [ "$(whoami)" == "root" ]; then
echo "running as root, please run as user you want to have stuff installed as"
exit 1
fi
###################################
# Ubuntu 14.04 Install script for: