Skip to content

Instantly share code, notes, and snippets.

Arnav Singh Arnavion

Block or report user

Report or block Arnavion

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
View d3d12.rs
RIDL!{#[uuid(0xc4fec28f, 0x7966, 0x4e95, 0x9f, 0x94, 0xf4, 0x31, 0xcb, 0x56, 0xc3, 0xb8)]
interface ID3D12Object(ID3D12ObjectVtbl): IUnknown(IUnknownVtbl) {
fn GetPrivateData(
guid: *mut GUID,
pDataSize: *mut UINT,
pData: *mut c_void,
) -> HRESULT,
fn SetPrivateData(
guid: *mut GUID,
DataSize: UINT,
View spellcheck.rs
// Implements ISpellCheckerFactory
// Implements IUserDictionariesRegistrar
pub struct SpellCheckerFactory {
_use_cocreateinstance_to_instantiate: (),
}
impl SpellCheckerFactory {
#[inline]
pub fn uuidof() -> GUID {
GUID {
View wbemcli.rs
RIDL!{#[uuid(0xdc12a681, 0x737f, 0x11cf, 0x88, 0x4d, 0x00, 0xaa, 0x00, 0x4b, 0x2e, 0x24)]
interface IWbemClassObject(IWbemClassObjectVtbl): IUnknown(IUnknownVtbl) {
fn GetQualifierSet(
ppQualSet: *mut *mut IWbemQualifierSet,
) -> HRESULT,
fn Get(
wszName: LPCWSTR,
lFlags: i32,
pVal: *mut VARIANT,
pType: *mut i32,
@Arnavion
Arnavion / taskschd.rs
Created Aug 14, 2018
winapi-tlb-bindgen-bin taskschd.dll
View taskschd.rs
RIDL!{#[uuid(0x79184a66, 0x8664, 0x423f, 0x97, 0xf1, 0x63, 0x73, 0x56, 0xa5, 0xd8, 0x12)]
interface ITaskFolderCollection(ITaskFolderCollectionVtbl): IDispatch(IDispatchVtbl) {
fn get_Count(
pCount: *mut i32,
) -> HRESULT,
fn get_Item(
index: VARIANT,
ppFolder: *mut *mut ITaskFolder,
) -> HRESULT,
fn get__NewEnum(
View oleexp.rs
STRUCT!{struct UUID {
Data1: i32,
Data2: i16,
Data3: i16,
Data4: [u8; 8],
}}
STRUCT!{struct PROPERTYKEY {
fmtid: UUID,
pid: i32,
@Arnavion
Arnavion / doc.md
Created Sep 8, 2017
tiny-async-await
View doc.md

A tiny crate that provides async and await macros to create futures::Futures and futures::Streams.

Code that uses these macros requires #![feature(conservative_impl_trait, generators)]

  • Returning a futures::Future

     #![feature(conservative_impl_trait, generators)]
    
     #[macro_use]
@Arnavion
Arnavion / cargoall.ps1
Created May 16, 2017
Recurse into workspace crates / subdirectories and run the given command
View cargoall.ps1
function cargoall ([ScriptBlock] $ScriptBlock) {
if (Test-Path '.\Cargo.toml') {
# Workspace root
(cargo metadata --no-deps --format-version 1 | ConvertFrom-Json).packages |
%{ ([System.IO.FileInfo] $_.manifest_path).Directory } |
%{
Write-Host -ForegroundColor Green $_.FullName
Push-Location $_
&$ScriptBlock
Pop-Location
@Arnavion
Arnavion / make_deserializable.rs
Last active Oct 3, 2016
Macro for deserializing structs from JSON for Rust stable
View make_deserializable.rs
//! Exports a single macro named make_deserializable that can be used in place of #[derive(serde::Deserialize)] on structs.
//! Supports regular structs and tuple structs of u64.
//! Only works with JSON deserialization.
//!
//! Eg: make_deserializable!(struct Foo { bar: String, baz: i32, });
//! Eg: make_deserializable!(struct Bar(u64));
macro_rules! impl_deserialize_struct {
(struct $struct_name:ident {
$($field_name:ident: $field_type:ty,)*
View async-await.ts
async function first<T>(promises: Promise<T>[]): Promise<T> {
const rejections: any[] = [];
for (const promise in promises) {
try {
return await promise;
}
catch (reason) {
rejections.push(reason);
}
You can’t perform that action at this time.