This file contains hidden or 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
require 'yaml' | |
d = Dir["./**/*.yml"] | |
d.each do |file| | |
begin | |
puts "checking : #{file}" | |
f = YAML.load_file(file) | |
rescue Exception | |
puts "failed to read #{file}: #{$!}" | |
end |
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.ComponentModel.DataAnnotations; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using System.Reflection; | |
using System.Text; | |
using System.Text.RegularExpressions; |
This file contains hidden or 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
# load PATH environment variable | |
$env:path += ";C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE" |
This file contains hidden or 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 class MessagingExtensions | |
{ | |
public static IMessaging Messaging(this SomeType target) | |
{ | |
return MessagingFactory(target); | |
} | |
static MessagingExtensions() | |
{ | |
MessagingFactory = st => new Messaging(st); |
This file contains hidden or 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
Backbone.Collection.extend({ | |
add: function(models, options) { | |
models.doSomethingSpecific(); | |
return Backbone.Collection.prototype.add.call(this, models, options); | |
} | |
}) |
This file contains hidden or 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 class TypeExtensions | |
{ | |
public static bool IsGenericTypeAssignableFrom(this Type genericType, Type givenType) | |
{ | |
var interfaceTypes = givenType.GetInterfaces(); | |
if (interfaceTypes.Any(it => it.IsGenericType && it.GetGenericTypeDefinition() == genericType)) | |
{ | |
return true; | |
} |
This file contains hidden or 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 class RetryUtility | |
{ | |
public static void RetryAction( Action action, int numRetries, int retryTimeout ) | |
{ | |
if( action == null ) | |
throw new ArgumentNullException("action"); // slightly safer... | |
do | |
{ | |
try { action(); return; } |
This file contains hidden or 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
Invoke-RestMethod -Uri https://api.parse.com/restmethodspec ` | |
#-Body (@{} | ConvertTo-Json) ` #empty object | |
-Body (@{"name"="value"} | ConvertTo-Json) ` | |
-ContentType "application/json" ` | |
-Headers @{ ` | |
"X-Parse-Application-Id"="senstitive"; ` | |
"X-Parse-REST-API-Key"="senstitive" } ` | |
-Method Post |
This file contains hidden or 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
function guidGen() { | |
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { | |
var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8); | |
return v.toString(16); | |
}); | |
} |
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using Microsoft.VisualStudio.TestTools.WebTesting; | |
namespace GabesWebTesting.Extraction | |
{ | |
public class ExtractArrayFields : ExtractionRule | |
{ | |
public const string ArrayRootElementPlaceholderName = "root"; |