Skip to content

Instantly share code, notes, and snippets.

View Chippiewill's full-sized avatar
🤠

Will Gardner Chippiewill

🤠
View GitHub Profile
tilda_config_version="1.3.1"
# command=""
font="Ubuntu Mono derivative Powerline 12"
key="<Primary>grave"
addtab_key="<Shift><Control>t"
fullscreen_key="<Primary>Return"
toggle_transparency_key="F12"
toggle_searchbar_key="<Shift><Control>f"
closetab_key="<Shift><Control>w"
nexttab_key="<Control>Page_Down"
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/(?:\ Ballot169)?
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
template <class Clock, class Duration = typename Clock::duration>
class atomic_time_point {
public:
using clock = Clock;
using base_time_point = typename std::chrono::time_point<Clock, Duration>;
using duration = Duration;
using rep = typename duration::rep;
constexpr atomic_time_point() {}
constexpr explicit atomic_time_point(const duration& d)
#include <iostream>
class MyClass {
private:
int my_private_member;
public:
static int MyClass::* p;
int member_val() {
return my_private_member;
@Chippiewill
Chippiewill / md5.cc
Created February 23, 2017 09:15
md5 hls
/*
* Simple MD5 implementation
*
* Compile with: gcc -o md5 md5.c
*/
#include <stdlib.h>
#include <string.h>
#include "md5.h"
@Chippiewill
Chippiewill / md5.cc
Created February 23, 2017 09:15
md5 hls
/*
* Simple MD5 implementation
*
* Compile with: gcc -o md5 md5.c
*/
#include <stdlib.h>
#include <string.h>
#include "md5.h"
@Chippiewill
Chippiewill / unique_lock_ref.cc
Created February 15, 2017 23:05
unique_lock_ref
#include <iostream>
#include <mutex>
template <typename mutex>
struct unique_lock_ref {
unique_lock_ref(const std::unique_lock<mutex>& lh) {
if (!lh) {
throw std::logic_error("Cannot instantiate a unique_lock_ref "
"with an unlocked unique_lock");
}
namespace cb {
/**
* Intrusive map generates the key for the map based on the mapped
* value and a KeyFunc supplied as a template parameter.
*/
template <class KeyFunc,
class T,
class Hash = std::hash<Key>,
class KeyEqual = std::equal_to<Key>,
diff --git a/engines/utilities/engine_error.cc b/engines/utilities/engine_error.cc
index 7fc1f63..e16d299 100644
--- a/engines/utilities/engine_error.cc
+++ b/engines/utilities/engine_error.cc
@@ -63,6 +63,11 @@ public:
return iter->second;
}
}
+
+ std::error_condition default_error_condition(int code) const NOEXCEPT override {
diff --git a/include/memcached/engine_error.h b/include/memcached/engine_error.h
index fafcb44..e97003c 100644
--- a/include/memcached/engine_error.h
+++ b/include/memcached/engine_error.h
@@ -93,6 +93,10 @@ public:
: system_error(int(ev), engine_error_category(), what_arg) {}
};
+static inline std::error_condition make_error_condition(cb::engine_errc e) NOEXCEPT {
+ return std::error_condition(int(e), cb::engine_error_category());