Skip to content

Instantly share code, notes, and snippets.

View willasrari's full-sized avatar

Will Asrari willasrari

View GitHub Profile
@willasrari
willasrari / DateTimeExtensions.cs
Last active February 17, 2024 01:53
While working on a small OAuth library tonight I found the need to create a timestamp. The requirements for the timestamp called for seconds from Unix Epoch (1/1/1970). This seemed like a perfect candidate for an extension method. I thought that this would be a good starting point.
using System;
namespace Hossware.Extensions
{
public static class DateTimeExtensions
{
public static long SecondsSinceJanuary11970(this DateTime input)
{
TimeSpan timeSpan = input - new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
@willasrari
willasrari / gist:4702971
Last active December 12, 2015 02:58
sample HTML for a proof-of-concept hybrid iOS tutorial
<html>
<head>
<title>Hoss Web</title>
<meta name="viewport" content="width=device-width">
<script type="text/javascript" language="javascript">
function hossFunction() {
document.getElementById('divFormHoss').style.display = '';
document.getElementById('divConfirmation').style.display = 'none';