Skip to content

Instantly share code, notes, and snippets.

View jonwingfield's full-sized avatar

Jon Wingfield jonwingfield

View GitHub Profile
@jonwingfield
jonwingfield / Notes.md
Created December 7, 2024 15:48
Getting Full SMB Speed on Mac

Is your switch a managed switch and does your router support VLANs? If not, this won't be possible. You would follow the instructions for your specific switch to associate the different ports on the switch to the different VLANs and you would create the VLANs on the router. If either your router or switch doesn't support VLANs, this won't work. The synology-connected ports on the switch should be PVID in each of the VLANs subsequently (port 1, VLAN 1, port 2, VLAN2, etc.). The switch port that connects to the Mac (and to the router) would be a trunk port for all those VLANs and you would create new virtual interfaces on the Mac for the 10GbE port for all those VLANs. What will happen is that you basically will have four different subnets in your network with your 10GbE port on your Mac connected to all 4 with 4 different IP addresses in the 4 subnets and the 4 ports on the synology each only being in one of the subnets. Make sure that your router blocks traffic between the subnets so all traffic will flow jus

@jonwingfield
jonwingfield / conditional_types.ts
Last active January 4, 2020 19:57
Conditional Types
// From https://artsy.github.io/blog/2018/11/21/conditional-types-in-typescript/
// Includes extra exercises.
type Action =
| {
type: "INIT"
}
| {
type: "SYNC"
}
@jonwingfield
jonwingfield / c_wrapper.h
Created February 5, 2016 14:11
Example C Wrapper for a C++ Class
#ifdef __cplusplus
#define CCALL extern "C"
CCALL RF24* rf24_init(uint8_t ce_pin, uint8_t cs_pin) { return new RF24(ce_pin, cs_pin); }
CCALL void rf24_begin(RF24* rf24) { rf24->begin(); }
CCALL void rf24_free(RF24* rf24) { delete rf24; }
#else
typedef struct {} RF24;
@jonwingfield
jonwingfield / gist:7485934
Last active December 28, 2015 10:19
Church Numerals in Clojure
; f -> x -> x
(def zero
(fn [f,x] x))
; 1: f -> x -> f(x)
(def one
(fn [f,x] (f x)))
; 2: f -> x-> f(f(x))
(def two