Skip to content

Instantly share code, notes, and snippets.

View myscienceisbetter's full-sized avatar

myscienceisbetter myscienceisbetter

View GitHub Profile
Root cause
On macOS, native-tls uses Security.framework which fails to properly present client certificates during mTLS handshakes with self-signed CAs (like Chia's). This causes error -9806 (errSSLClosedAbort) — the Chia node rejects the
connection.
Fix
Switch from native-tls to rustls for all TLS in the HTTP/REST layer. Three files need changes:
1. rust/xkv8r/Cargo.toml
@myscienceisbetter
myscienceisbetter / new_custom_post_type.php
Created June 2, 2016 15:51
New custom post type with taxonomy support in WordPress
function project_custom_init() {
$labels = array(
'name' => 'Project',
'singular_name' => 'Project',
'menu_name' => 'Projects'
);
$args = array(
'labels' => $labels,
'public' => true,
@myscienceisbetter
myscienceisbetter / new_custom_post_type.php
Created June 2, 2016 15:44
Create a custom post type in WordPress functions.php
function project_custom_init() {
$labels = array(
'name' => 'Project',
'singular_name' => 'Project',
'menu_name' => 'Projects'
);
$args = array(
'labels' => $labels,
'public' => true,
@myscienceisbetter
myscienceisbetter / gist:6240909
Last active December 21, 2015 03:19
MySQL select duplicates
SELECT *
FROM table_name a
WHERE EXISTS (
SELECT 1
FROM table_name b
WHERE b.name = a.name
LIMIT 1 , 1
)
ORDER BY name ASC