Skip to content

Instantly share code, notes, and snippets.

View CommanderPho's full-sized avatar

Pho Hale CommanderPho

View GitHub Profile
@CommanderPho
CommanderPho / Win32_FileTime_to_POSIX.c
Created July 25, 2019 19:23
Converts a Win32 FileTime into a POSIX LONGLONG Timestamp. Credit (https://www.frenk.com/2009/12/convert-filetime-to-unix-timestamp/)
// Converts a windows FILETIME structure to a POSIX timestamp
// https://www.frenk.com/2009/12/convert-filetime-to-unix-timestamp/
LONGLONG FileTime_to_POSIX(FILETIME ft)
{
// takes the last modified date
LARGE_INTEGER date, adjust;
date.HighPart = ft.dwHighDateTime;
date.LowPart = ft.dwLowDateTime;
// 100-nanoseconds = milliseconds * 10000
@CommanderPho
CommanderPho / ThrowingOperators.swift
Last active June 27, 2018 02:51 — forked from wircho/ThrowingOperators.swift
Arithmetic operators that throw on integer type overflow and floating point type errors.
//
// ThrowingMathematicalOperators.swift
// Dose
//
// Created by Pho Hale on 6/26/18.
// Copyright © 2018 Pho Hale. All rights reserved.
//
import Darwin
import Swift
@CommanderPho
CommanderPho / 0_reuse_code.js
Last active November 18, 2016 11:35
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console