Skip to content

Instantly share code, notes, and snippets.

View phillip-haydon's full-sized avatar
💭
Banana's are yellow.

Phillip Haydon phillip-haydon

💭
Banana's are yellow.
View GitHub Profile
@phillip-haydon
phillip-haydon / postgresql trigger.sql
Created June 19, 2016 05:05
Example trigger to update doc into tsvestor
drop table if exists searchable_table_test;
create table if not exists searchable_table_test (
id serial primary key not null,
data jsonb not null,
searchable tsvector null
);
@phillip-haydon
phillip-haydon / debug.md
Created March 5, 2016 14:20
Beautify Debug 2
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.Use(typeof(InjectDebugJsAndMinifyHtml));
app.UseNancy();
}
}
public class InjectDebugJsAndMinifyHtml : OwinMiddleware
@phillip-haydon
phillip-haydon / gist:7dfa736ba70bfb34297e
Created March 27, 2015 07:50
Autofixture Base Types and Recursion.
[TestFixture]
public class TestStuffs
{
[Test, Category(TestCategories.Unit)]
public void Fail()
{
var fixture = new Fixture().Customize(new TestCustomization());
var result = fixture.Create<TestClass>();
}
### Keybase proof
I hereby claim:
* I am phillip-haydon on github.
* I am philliphaydon (https://keybase.io/philliphaydon) on keybase.
* I have a public key whose fingerprint is 3D64 CCA4 3930 0403 BBCD 7ECB 3CF7 C766 2ADD 0C47
To claim this, I am signing this object:
private HttpActionContext actionContext;
private HttpControllerContext controllerContext;
private UserContextFilter filter;
private HttpRequestHeaders headers;
private HttpRequestMessage requestMessage;
private Mock<IUserContextService> userContextService;
private Mock<HttpActionDescriptor> actionDescriptor;
private Mock<HttpParameterDescriptor> parameterDescriptor;
[SetUp]
http://philliphaydon.com/stuffz/DSC00089.jpg
http://philliphaydon.com/stuffz/DSC00166.jpg
http://philliphaydon.com/stuffz/DSC00377.jpg
http://philliphaydon.com/stuffz/DSC00400.jpg
http://philliphaydon.com/stuffz/DSC01201.jpg
http://philliphaydon.com/stuffz/DSC01482.jpg
http://philliphaydon.com/stuffz/DSC02497.jpg
PM> Install-Package ServiceStack -Version 3.9.71
Attempting to resolve dependency 'ServiceStack.Common (= 3.0 && < 4.0)'.
Attempting to resolve dependency 'ServiceStack.Text'.
Attempting to resolve dependency 'ServiceStack.Redis (= 3.0 && < 4.0)'.
Attempting to resolve dependency 'ServiceStack.OrmLite.SqlServer (= 3.0 && < 4.0)'.
Installing 'ServiceStack.Text 4.0.33'.
You are downloading ServiceStack.Text from Service Stack, the license agreement to which is available at https://servicestack.net/terms. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'ServiceStack.Text 4.0.33'.
Installing 'ServiceStack.Common 3.9.11'.
Successfully installed 'ServiceStack.Common 3.9.11'.
@phillip-haydon
phillip-haydon / gist:1bf930eebb8bbbc16faf
Created October 23, 2014 16:08
Upload text file that does not exist
(function() {
var button = document.getElementById("TestUpload");
function setupRequest() {
var xhr = new XMLHttpRequest();
xhr.open('POST', "/home/upload", true);
xhr.setRequestHeader("Accept", "application/json");