Skip to content

Instantly share code, notes, and snippets.

View danielgtaylor's full-sized avatar

Daniel G. Taylor danielgtaylor

  • iStreamPlanet
  • Seattle, WA
View GitHub Profile
@danielgtaylor
danielgtaylor / git diff
Created October 15, 2014 23:22
PEP8 Readability
diff --git a/tests/unit/resources/test_factory.py b/tests/unit/resources/test_factory.py
index 544ee61..2ef49c3 100644
--- a/tests/unit/resources/test_factory.py
+++ b/tests/unit/resources/test_factory.py
@@ -41,7 +41,7 @@ class TestResourceFactory(BaseTestCase):
self.factory.create_class('test')
self.assertTrue(self.factory.load_from_definition.called,
- 'Class was not loaded from definition')
+ 'Class was not loaded from definition')
@danielgtaylor
danielgtaylor / credentials.py
Created March 10, 2015 22:05
Credential Resolver Proposal
def create_credential_resolver(session):
"""Create a default credential resolver.
This creates a pre-configured credential resolver
that includes the default lookup chain for
credentials.
"""
profile_name = session.get_config_variable('profile') or 'default'
credential_file = session.get_config_variable('credentials_file')
@danielgtaylor
danielgtaylor / gist:3764290
Created September 21, 2012 22:27
Malt.io widget embed example
<!-- Malt.io Recipe Widget - copy and paste to your site -->
<script src="http://www.malt.io/static/scripts/embed.js"></script>
<div class="maltio-recipe" data-recipe="white-house-honey-ale" data-user="danielgtaylor" style="float: left; margin-right: 1em;"></div>
<div class="maltio-recipe" data-recipe="monk-s-tripel" data-user="danielgtaylor" style="float: left;"></div>
@danielgtaylor
danielgtaylor / gist:3764319
Created September 21, 2012 22:36
Malt.io Recipe Widget Width Example
<div class="maltio-recipe" data-recipe="monk-s-tripel" data-user="danielgtaylor" data-width="500"></div>
@danielgtaylor
danielgtaylor / gist:3955072
Created October 25, 2012 20:03
Example httpie call for Malt.io API
$ http https://maltioweb.appspot.com/_ah/api/maltio/v1/recipes limit==1 order==LIKES
HTTP/1.1 200 OK
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Date: Tue, 30 Oct 2012 18:34:17 GMT
ETag: "8xJp6-t04hAv0QlZ8diuygX5EF8/R4Slr4GR8josHmd2u6O0ZhjkW6g"
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Pragma: no-cache
Server: GSE
Transfer-Encoding: chunked
@danielgtaylor
danielgtaylor / example.apib
Created November 5, 2015 18:54
API Blueprint error attributes example for Aglio
FORMAT: 1A
# Example API
This is an example showing error information like Stripe does.
## Errors
Errors returned by this API take the following format:
```json
{
@danielgtaylor
danielgtaylor / gist:5065626
Last active December 14, 2015 09:29
Calculating gravities, color, IBU, alcohol by volume, and calories for a beer recipe.
<script type="text/javascript" src="/scripts/brauhaus.min.js"></script>
<script type="text/javascript">
// Create a recipe
var r = new Brauhaus.Recipe({
name: 'My test brew',
description: 'A new test beer using Brauhaus.js!',
batchSize: 20.0,
boilSize: 10.0
});
@danielgtaylor
danielgtaylor / mash-example.coffee
Created May 1, 2013 15:50
Brauhaus.js mashing example
Brauhaus = require 'brauhaus'
# Create a new recipe
recipe = new Brauhaus.Recipe
name: 'My new recipe'
batchSize: 20.0
# Add some grain to be mashed
recipe.add 'fermentable',
name: 'Pale malt'
@danielgtaylor
danielgtaylor / index.html
Created May 13, 2013 16:05
Brauhaus.js getting started in the web browser
<html>
<head>
<title>Brauhaus.js Test</title>
</head>
<body>
<p>
Let's make some beer!
</p>
<script type="text/javascript" src="/scripts/brauhaus.min.js"></script>
<script type="text/javascript">
@danielgtaylor
danielgtaylor / 01-recipe.js
Last active December 17, 2015 06:59
Brauhaus.js examples
// Create a new recipe
var recipe = new Brauhaus.Recipe({
name: 'Daniel\'s Doppelbock',
description: '...',
author: 'Daniel G. Taylor'
batchSize: 20.0,
boilSize: 10.0
});