Skip to content

Instantly share code, notes, and snippets.

Avatar

Tom Slankard twslankard

View GitHub Profile
View array_by_reference.cpp
#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 Dec 30, 2010
jquery load example
View gist:760182
<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 Oct 20, 2010
Verifying Amazon SNS Notification Signatures
View gist:637020
<?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;