Since MS is keeping more and more copilot in the UI of this site, this may become outdated after a while.
Anyway, at this point it is probably better to jump ship, but there are still plenty of valid reasons to stick with this site for now.
Since MS is keeping more and more copilot in the UI of this site, this may become outdated after a while.
Anyway, at this point it is probably better to jump ship, but there are still plenty of valid reasons to stick with this site for now.
Adapted from this gist, as the original one seems to have some formatting problems. All credits go to the original creator.
auto locate_asset_path(const std::filesystem::path& current_path) | |
-> std::optional<std::filesystem::path> | |
{ | |
namespace fs = std::filesystem; | |
std::optional<fs::path> result = std::nullopt; | |
for (auto path = current_path; path != current_path.root_path(); | |
path = path.parent_path()) { | |
const auto assets_path = path / "assets"; | |
if (exists(assets_path) && is_directory(assets_path)) { |
template <typename Callable, typename... Params> | |
auto curry(Callable f, Params... ps) | |
{ | |
if constexpr (requires { f(ps...); }) { | |
return f(ps...); | |
} else { | |
return [f, ps...] (auto... qs) | |
{ | |
return curry(f, ps..., qs...); | |
}; |
<?xml version="1.0" encoding="UTF-8"?> | |
<opml version="1.0"> | |
<head> | |
<title>Feeds of Lesley Lai from Inoreader [https://www.inoreader.com]</title> | |
</head> | |
<body> | |
<outline text="Arts" title="Arts"> | |
<outline text="Sarah's Scribbles" title="Sarah's Scribbles" type="rss" xmlUrl="https://sarahcandersen.com/rss" htmlUrl="http://sarahcandersen.com/"/> | |
</outline> | |
<outline text="Tech Blog" title="Tech Blog"> |
#include <type_traits> | |
namespace detail { | |
template <typename Func> | |
struct function_trait; | |
#define BEYOND_NOARG | |
#define BEYOND_FUNCTION_TRAIT(CV_OPT, NOEXCEPT_OPT) \ |
module Main exposing (..) | |
import Browser | |
import Html exposing (Html) | |
import Svg exposing (..) | |
import Svg.Attributes exposing (..) | |
import Svg.Lazy | |
import Task | |
import Time | |
import Random |
#ifndef AND_THEN_HPP | |
#define AND_THEN_HPP | |
#include <optional> | |
#include <functional> | |
#include <type_traits> | |
template<typename T1, | |
typename Func, | |
typename Input_Type = typename T1::value_type, |
#ifndef BENCHMARK_HPP | |
#define BENCHMARK_HPP | |
/*! | |
* \file benchmark.hpp | |
* | |
* Benchmark for functions in C++. Use it only in release mode. | |
*/ | |
#include <iostream> | |
#include <functional> |
(defun recompile-elc-on-save () | |
"If you're saving an elisp file, likely the .elc is no longer valid." | |
(make-local-variable 'after-save-hook) | |
(add-hook 'after-save-hook | |
(lambda () | |
(if (file-exists-p (byte-compile-dest-file buffer-file-name)) | |
(byte-compile-file buffer-file-name))))) | |
(add-hook 'emacs-lisp-mode-hook 'recompile-elc-on-save | |
) |