Skip to content

Instantly share code, notes, and snippets.

View svrist's full-sized avatar

Søren B. Vrist svrist

View GitHub Profile
<xml>
<test attr="lalala">
mydata
</test>
</xml>
@svrist
svrist / gist:2170235
Created March 23, 2012 12:26
Freeze false -> Func<bool>() == true?
[Test]
public void TestFxitureFreeze()
{
Fixture fixture = new Fixture();
fixture.Freeze(false);
var f = fixture.CreateAnonymous<Func<bool>>();
Assert.That(f(),Is.False); // fails
}

Keybase proof

I hereby claim:

  • I am svrist on github.
  • I am svrist (https://keybase.io/svrist) on keybase.
  • I have a public key whose fingerprint is 6325 6FE1 EB39 3F9B B2E9 025A 9481 7B5D 902F 56CC

To claim this, I am signing this object:

----
title: CPH:Triathlon – Race report
author: svrist
date: 2015-02-20
aliases:
- /2015/02/20/cphtriathlon-race-report/
lightbox: True
{{ $suffix := or (.Get "suffix") "jpg" }}
{{ $size := or (.Get "size") "150x150" }}
{{ with .Get "file" }}
<dl class="gallery-item">
<dt class="gallery-icon landscape">
<a href="PREFIX/{{ . }}.{{ $suffix }}" data-lightbox="set1"
data-title="{{ $.Get "caption" }}" >
<img
src="PREFIX/{{ . }}-{{ $size }}.{{ $suffix }}"
itemprop="thumbnail"
@svrist
svrist / _pathmangle.py
Created February 7, 2017 18:17
Mangle sys.path to include lambda zipped vendored python dependencies
import os
import sys
if 'LAMBDA_TASK_ROOT' in os.environ:
here = os.path.dirname(__file__)
vendored = os.path.join(here, 'vendored')
if os.path.isdir(vendored):
sys.path.append(vendored)
@svrist
svrist / lambdahelper.py
Created February 7, 2017 19:44
serverless framework friendly logformat
from __future__ import division, print_function, unicode_literals
import logging
import os
def setup_logging():
'serverless framework friendly logformat'
if 'LAMBDA_TASK_ROOT' not in os.environ:
return
from __future__ import division, print_function, unicode_literals
import _pathmangle # noqa # pylint: disable=W0611
import lambdahelper # noqa # pylint: disable=W0611
lambdahelper.setup_logging() # noqa
import json
import psycopg2
@svrist
svrist / cf_create_or_update.py
Created February 7, 2017 21:34
Update or create a CloudFormation stack given a name and template + params'
'Update or create a stack given a name and template + params'
from __future__ import division, print_function, unicode_literals
from datetime import datetime
import logging
import json
import sys
import boto3
import botocore