Skip to content

Instantly share code, notes, and snippets.

View gmcdev's full-sized avatar
🌳
Growing

Greg Connell gmcdev

🌳
Growing
View GitHub Profile
this.minutesFromUtcTo = function( tzDesignation, context ) {
if( !context ) context = new Date();
var dstOffset = this.getDstOffsetFor( context );
var minutesToUtc;
switch( tzDesignation.label ) {
case this.TZ_UTC.label:
minutesToUtc = 0
break;
case this.TZ_ART.label:
case this.TZ_EST.label:
# -- USE THIS SCRIPT TO TEST MODEL and COMPOSITE SCRIPTS ----
#
# Execute from terminal with arguments seperated by spaces
# Arguments:
# - site_id, currently 1 or 2
# - video_id, corresponds to key in model
# - path to folder containing all the base-video folders
# - path to write rendered video to
# - location of the name-card image
# - location of the vo-webcam video
/** This method will make a list of dates available to the Static Generator application which will then make
snapsnots of the ad's endframe on each of these dates. If only one date is submitted, Static Generator will
assume the same intervals that <DateUtils>.selectMessagingForDate uses.
$_dates - list of dates that snapshots will be taken on
$_tzDesignation - the timezone in which this schedule expresses its dates */
public function setStaticSchedule( $_dates:Array, $_tzDesignation:Object=null, $_dateLabels:Array=null ):void {
Trace.out( this, 'setStaticSchedule()' );
if( !$_dateLabels ) $_dateLabels = [];
if( $_dates.length == 1 ) {
protocol.interceptBufferProtocol( 'file', function( request, callback ) {
var fileName = url.parse( request.url ).pathname;
var data = fs.readFileSync( fileName );
try {
var extension = fileName.match( /\.([^\.]*)$/ )[ 1 ];
var mimeType = mime.lookup( extension );
if( extension == 'ejs' ) {
var fileContents = data.toString( 'utf-8' );
userOpts.filename = fileName;
userOpts.ejse = self;
// LOAD MONET DATA
self.prepareMonet = function() {
trace( id + '.prepareMonet()' );
async.wait();
var monetRequest = Monet.buildMonetRequest();
Monet.load(
monetRequest,
self.handleMonetLoadComplete,
self.handleMonetLoadFail
@gmcdev
gmcdev / get-current-crypto-prices.js
Last active December 6, 2021 17:47
Map current cryptocurrency prices into Google Sheets
/* USAGE:
* Sheet -> Tools -> Script Editor...
* Paste this script
* Update the map (below) to your preferences
* Create a button in your Sheet and Assign Script: `test`
* et voila profit
*/
function test() {
// maps currencies.tokens to sheet ranges
getPrices({
{
"rootComponents": [
{
"type": "image",
"id": "Logo",
"url": "https://ae.nflximg.net/assets/prod/1ea8fd73-2779-41f0-b729-858c3e8c3130/20170820/95c8beac-3f63-44ed-8122-90b23e3916d6.png"
},
null,
{
"type": "bool",
0xCB2355213dEf96207e202606aE5fda6b33a62977
0x9dEbAc63ADb27Cd2eB0A01042760bF233924C5fa
0x11A9F9354b3B301A778AF60c4EcbC5C4D7490b8D