Skip to content

Instantly share code, notes, and snippets.

View sgithens's full-sized avatar

Steven Githens sgithens

View GitHub Profile
{
"clustered": false,
"data": [
{
"count": 3,
"values": [
1
]
},
Values Endpoint
{
"_links": {
"base": {
"href": "http://localhost:8000/api/fields/131/values/"
},
"parent": {
"href": "http://localhost:8000/api/fields/131/"
},
@sgithens
sgithens / gist:9982020
Last active August 29, 2015 13:58
Judy-san: Possible way of detecting duplicate patients by creating mathematical sets from each part of their name.
"""
We will create several patients who have an ID, fname, mname, lname
and then check for those that switched parts of their name.
"""
from collections import defaultdict
patients = (
(1, "Judy", "Wawira", "Gichoya"),
(2, "Steven", "Wilbur", "Githens"),
(3, "Gichoya", "Wawira", "Judy"),
(4, "Some", "Random", "Person"),
gpii.invokeGradedFunction = function (name, spec) {
var defaults = fluid.defaults(name);
if (!defaults.argumentMap || !fluid.hasGrade(defaults, "fluid.function")) {
fluid.fail("Cannot look up name " + name + " to a function with registered argumentMap - got defaults ", defaults);
}
var args = [];
fluid.each(defaults.argumentMap, function (value, key) {
args[value] = spec[key];
});
return fluid.invokeGlobalFunction(name, args);
@sgithens
sgithens / gpii.js
Last active August 29, 2015 14:05
Adding a REPL to your gpii instance.
var fluid = require("universal"),
kettle = fluid.registerNamespace("kettle");
require("./gpii/index.js");
kettle.config.makeConfigLoader({
nodeEnv: kettle.config.getNodeEnv("fm.ps.sr.dr.mm.os.lms.development"),
// TODO: it would be nice to not have to hardcode this path.
configPath: kettle.config.getConfigPath() || "../node_modules/universal/gpii/configs"
});
@sgithens
sgithens / gist:ba1640625bdbb2c728eb
Created August 27, 2014 00:22
GPII url handler register
var defs = fluid.indexDefaults("myIndex", {gradeNames: "kettle.app",
indexFunc: function () { return ["myKey"]}});
for (var i=0; i < defs.myKey.length; i++) {
console.log(fluid.getGradedDefaults(defs.myKey[i]).handlers);
}
> var logMakeInvoker = l.filter(fluid.activityTrace, function(i) { return i.type === 'makeInvoker'; });
undefined
> log
logInitComponents logMakeInvoker
> logMakeInvoker
[ { type: 'makeInvoker',
message: 'beginning instantiation of invoker with name %name and record %record as child of %that',
args:
{ name: 'ensureResCompleted',
20:36:07.113: Fetched raw user preferences: {
"userToken": "hrm_livia",
"preferences": {
"flat": {
"contexts": {
"gpii-default": {
"name": "Default preferences",
"preferences": {
"applications": {
@sgithens
sgithens / gist:4b1fdc5b780b43be336b
Created February 11, 2015 01:52
Checking windows api constants for use in node-fi
// https://msdn.microsoft.com/en-us/library/windows/desktop/ms682489(v=vs.85).aspx
// TH32CS_SNAPALL
// Includes all processes and threads in the system, plus the heaps and modules of
// the process specified in th32ProcessID. Equivalent to specifying the
// TH32CS_SNAPHEAPLIST, TH32CS_SNAPMODULE, TH32CS_SNAPPROCESS, and
// TH32CS_SNAPTHREAD values combined using an OR operation ('|').
var TH32CS_SNAPHEAPLIST = 0x00000001;
diff --git a/testData/solutions/win32.json b/testData/solutions/win32.json
index 708ff99..ba8997d 100644
--- a/testData/solutions/win32.json
+++ b/testData/solutions/win32.json
@@ -81,7 +81,7 @@
{
"type": "gpii.settingsHandlers.XMLHandler",
"options": {
- "filename": "${{environment}.APPDATA}\\Texthelp Systems\\ReadAndWrite\\10\\RWSettings10.xml",
+ "filename": "${{environment}.APPDATA}\\Texthelp\\ReadAndWrite\\11\\RWSettings11.xml",