Skip to content

Instantly share code, notes, and snippets.

View jerodfritz's full-sized avatar
🚍
Working

Jerod Fritz jerodfritz

🚍
Working
View GitHub Profile
@jerodfritz
jerodfritz / isOwners.js
Last active October 9, 2023 14:21
Strapi isOwners.js policy
'use strict';
/**
* `isOwners` policy that allows for many owners and a private field == false individual querying or sharing with multiple users as readonly
*/
const _ = require('lodash');
let compareIDs = (a, b) => {
return a.toString() === b.toString();
}
@jerodfritz
jerodfritz / isOwner.js
Created October 26, 2021 14:08
Strapi isOwners.js policy
'use strict';
/**
* `isOwner` policy.
*/
var pluralize = require('pluralize')
module.exports = async (ctx, next) => {
try {
let errMsg = "You are not allowed to perform this action.";
@jerodfritz
jerodfritz / gifmaker.js
Created July 31, 2012 16:19
gifmaker invocation
var timeStamp = new Date().getTime();
var filename = 'MoTracker_' + timeStamp + '.mov';
var movTargetFile = moTrackerImagesFolderExports.nativePath.substring(16) + filename;
var framesPerSecond = 4;
var movSize = 320;
Ti.API.info(JSON.stringify(moTrackImagesArray));
Ti.API.info(movTargetFile);
var movOutput = gifmaker.createMOV(moTrackImagesArray, movTargetFile, framesPerSecond, movSize);
Ti.API.info(movOutput); //Output if true is successful, false if there was a failure