This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### variables | |
variable "env" {} | |
variable "riak_count" {} | |
variable "elastic_count" {} | |
### hostname.tpl | |
${name}-${env}-${format("%02s",index)} ${extra} | |
### ansible.tpl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am volak on github. | |
* I am charlessolar (https://keybase.io/charlessolar) on keybase. | |
* I have a public key ASD5acJoHNEmnZedsb8oi89yDiBPFeiN-2fDtvndby_n2Qo | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'C:\Program Files\Java\jdk1.8.0_101\bin\keytool.exe' -import -alias personal -trustcacerts -file selfsigned.crt -keystore 'C:\Program Files\Java\jre1.8.0_101\lib\security\cacerts' | |
'C:\Program Files\Java\jdk1.8.0_101\bin\keytool.exe' -import -alias personal -trustcacerts -file selfsigned.crt -keystore 'C:\Program Files\Java\jdk1.8.0_101\jre\lib\security\cacerts' | |
default pass: changeit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.GlobalRequestFilters.Add((httpReq, httpResp, requestDto) => | |
{ | |
var header = httpReq.Headers["Authorization"]; | |
if( header.IsNullOrEmpty() ) { | |
httpResp.StatusCode = (int)HttpStatusCode.Unauthorized; | |
httpResp.EndRequest(); | |
} | |
try |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// An easy way to create templated form inputs for large knockout projects | |
// Thanks to knockout 3.2 and components! | |
// Instead of defining control parameters on the binding or custom element like so: | |
<unrealistic-component | |
params='stringValue: "hello", | |
numericValue: 123, | |
boolValue: true, | |
objectValue: { a: 1, b: 2 }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Put in your main.js define | |
pace.start({ | |
document: false, | |
elements: false, | |
startOnPageLoad: false, | |
}); | |
router.isNavigating.subscribe((navigating) => { | |
if( navigating ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static IQueryable<dynamic> ToDynamic<T>(this IQueryable<T> query, ISet<String> fields) | |
{ | |
var pocoType = typeof(T); | |
var itemParam = Expression.Parameter(pocoType, "x"); | |
var members = fields.Select(f => Expression.PropertyOrField(itemParam, f)); | |
var addMethod = typeof(IDictionary<string, object>).GetMethod( | |
"Add", new Type[] { typeof(string), typeof(object) }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Security : Descriptor | |
{ | |
public Security() | |
{ | |
// When receiving queries of type Queries.GetItem users need permission GetItems | |
When.Receiving().Queries().OfType<Queries.GetItem>() | |
.Users().HavePermission("GetItems"); | |
// When recieving queries of type Queries.GetItem users need permission GetItems and users need permission Reading | |
When.Receiving().Queries().OfType<Queries.GetItem>(s => |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Security : IDescriptor | |
{ | |
public Security() | |
{ | |
// Action Target Securable | |
When.Receiving().Queries().OfType<Queries.GetItem>() | |
// Actors | |
.Allow(x => x.Users() | |
// Rule | |
.WithPermission("GetItems")) |