Skip to content

Instantly share code, notes, and snippets.

Nathan Wilson iancormac84

Block or report user

Report or block iancormac84

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
iancormac84 / error_response.json
Last active Aug 13, 2019
Gist displaying GraphQL, JSON, and Rust code snippets for help question.
View error_response.json
"message":"Variable \"$input\" expected value of type \"Owner\" which cannot be used as an input type.",
iancormac84 / Cargo.toml
Created Nov 25, 2018
Gist showing attempt to use Ole Automation to invoke OLE objects
View Cargo.toml
name = "accessole"
version = "0.1.0"
authors = ["iancormac84 <>"]
edition = "2018"
failure = "*"
oaidl = { git = "", branch = "develop" }
winapi = "0.3.6"
iancormac84 /
Last active May 23, 2019
How to work with WINAPI string types.
pub fn to_u16s<S: AsRef<OsStr>>(s: S) -> io::Result<Vec<u16>> {
fn inner(s: &OsStr) -> io::Result<Vec<u16>> {
let mut maybe_result: Vec<u16> = s.encode_wide().collect();
if maybe_result.iter().any(|&u| u == 0) {
return Err(io::Error::new(
"strings passed to WinAPI cannot contain NULs",
iancormac84 /
Last active Apr 19, 2018
Example of Chemical Element Modelling
pub trait UniqueProperties {
const ATOMIC_NUMBER: u32;
const SYMBOL: &'static str;
const PERIOD: u8;
pub struct Hydrogen;
impl UniqueProperties for Hydrogen {
const ATOMIC_NUMBER: u32 = 1;
View genesis_public_key
iancormac84 /
Created Sep 26, 2015
Example of creating a window with a PaintDc context and drawing to it using a brush. Probably incorrect.
// Copyright 2015 The Rust-Windows Project Developers. See the
// COPYRIGHT file at the top-level directory of this distribution.
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
//> or the MIT license
// <LICENSE-MIT or>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
You can’t perform that action at this time.