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
import sys | |
import json | |
originalString = sys.argv[1] | |
jsonPropertyName = sys.argv[2] | |
targetPropertyName = sys.argv[3] | |
indentLevel = int(sys.argv[4]) | |
content = json.loads(originalString) |
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
using System; | |
using Inversion.Process; | |
namespace Application.Configuration | |
{ | |
public static class Conditions | |
{ | |
public static IConfigurationElement EventMatch(string name, string value) | |
{ | |
return new Inversion.Process.Configuration.Element( |
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
// only fire "process-admin" message if: | |
// - there is a "user" object in the control state | |
// - it has an "email" property with value "admin@admin.com" | |
// - the context parameter "my-number" exists | |
// - it is safe to convert it to a 32-bit integer | |
new ParameterisedSequenceBehaviour("do-stuff", | |
new Configuration.Builder { | |
{"control-state", "has", "user"}, | |
{"control-state", "equals", "user.email", "admin@admin.com" }, |
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
Inversion.Naiad.ServiceContainer.Instance.RegisterNonSingleton("event-behaviours", | |
container => new List<IProcessBehaviour> | |
{ | |
new ParameterisedSequenceBehaviour("my-message", | |
new Configuration.Builder { | |
{"context", "flagged", "enable-next-message", "true"}, | |
{"control-state", "has", "user"}, | |
{"fire", "next-message"} | |
}) | |
}); |
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
// dependencies | |
var async = require('async'); | |
var AWS = require('aws-sdk'); | |
var gm = require('gm') | |
.subClass({ imageMagick: true }); // Enable ImageMagick integration. | |
var util = require('util'); | |
var fs = require('fs'); | |
// constants for bounding boxes | |
var widths = [1000, 800, 400, 200]; |
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
two possible URL schemes to pass arguments to a distance function: | |
/distance_between/mercury/earth | |
/mercury/distance_to/earth | |
alternative way of passing arguments to a function that accepts Hydra collection of things | |
POST to /distance_between | |
{ | |
"@type": "Collection", |
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
/* | |
We have a URL scheme where we are expecting these kinds of paths in a non-MVC system: | |
customers/{customer} | |
customers/{customer}/queue | |
customers/{customer}/queue/batches | |
customers/{customer}/queue/batches/{batch} | |
customers/{customer}/queue/batches/{batch}/completedImages | |
customers/{customer}/queue/batches/{batch}/errorImages | |
customers/{customer}/allImages |
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
// dependencies | |
var async = require('async'); | |
var AWS = require('aws-sdk'); | |
var gm = require('gm') | |
.subClass({ imageMagick: true }); // Enable ImageMagick integration. | |
var util = require('util'); | |
var fs = require('fs'); | |
// constants | |
var MAX_WIDTH = 800; |
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
// dependencies | |
var async = require('async'); | |
var AWS = require('aws-sdk'); | |
var gm = require('gm') | |
.subClass({ imageMagick: true }); // Enable ImageMagick integration. | |
var util = require('util'); | |
// constants | |
var MAX_WIDTH = 800; | |
var MAX_HEIGHT = 600; |
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 void Delete(User user) | |
{ | |
AssertIsStarted(); | |
Task.Run(async () => | |
await _collection.DeleteOneAsync( | |
new BsonDocument("_id", user.ID))) | |
.Wait(); | |
} |
NewerOlder