Skip to content

Instantly share code, notes, and snippets.

View twslankard's full-sized avatar

Tom Slankard twslankard

  • Ouster Inc.
  • San Francisco, CA
View GitHub Profile
#include <cstdio>
template <std::size_t N>
void printArray(const int (&arr)[N]) {
for (int i = 0; i < N-1; i++) {
printf("%d, ", arr[i]);
}
printf("%d\n", arr[N-1]);
}
@twslankard
twslankard / gist:760182
Created December 30, 2010 19:33
jquery load example
<html>
<head>
<script src="jquery.js" type="text/javascript"></script>
</head>
<body>
<div id="container">
</div>
<script type="text/javascript">
$('#container').load('hello.txt');
</script>
@twslankard
twslankard / gist:637020
Created October 20, 2010 18:35
Verifying Amazon SNS Notification Signatures
<?php
// get the raw HTTP post data
$postdata = file_get_contents('php://input');
// the post data is JSON, so let's decode it and grab the various fields
$json = json_decode($postdata);
$subject = $json->Subject;
$message = $json->Message;
$signature = $json->Signature;