View StrangerThings.ino
// https://gist.github.com/steveosoule/f9d98b58ae666bce6a6752cefa2d11aa
// https://www.arduino.cc/reference/en/
// http://www.instructables.com/id/Arduino-Based-Stranger-Things-Lights/
// https://github.com/FastLED/FastLED
/**
* GLOBAL CONFIGURATION
**/
#include <FastLED.h>
View miva-mvt-do-scheduled-task-update.xml
<mvt:assign name="g.xml" value="'
<Provision>
<Store code=\"' $ g.Store_Code $ '\">
<ScheduledTask_Update task=\"TASK NAME\">
<Description>TASK NAME</Description>
<Enabled>true</Enabled>
<NextRun>
<Year>' $ s.dyn_tm_year $ '</Year>
<Month>' $ s.dyn_tm_mon $ '</Month>
<Day>' $ s.dyn_tm_mday $ '</Day>
View ad-blocked-mvga-overrides.js
/**
If Google Analytics does not load (add-blocking, network issues, etc.),
Then we need to disable the MVGA tracking functions and let the forms/links submit normally.
*/
$(window).on('load', function add_ga_failsafes(){
if( typeof ga !== 'undefined' && typeof ga.create !== 'undefined' ){
return;
}
MVGA_Tracker.prototype.List_AddToBasketSubmit = function(e){};
MVGA_Tracker.prototype.RemoveFromBasketForms = function(e){};
View miva-logging-into-yyyy-mm-dd-folders.xml
<mvt:comment>
| ---------------------------------------------
| LOGGING
| ---------------------------------------------
</mvt:comment>
<mvt:comment>
| Create Log Folders based on date: /YYYY/MM/DD/
</mvt:comment>
<mvt:assign name="l.settings:log:folder_path:base" value="'/logs/'" />
View ansi2html.sh
#!/bin/sh
# SOURCE: http://www.pixelbeat.org/scripts/ansi2html.sh
# Convert ANSI (terminal) colours and attributes to HTML
# Licence: LGPLv2
# Author:
# http://www.pixelbeat.org/docs/terminal_colours/
# Examples:
View template-engine.js
// http://mir.aculo.us/2011/03/09/little-helpers-a-tweet-sized-javascript-templating-engine/
function t(s,d){
for(var p in d)
s=s.replace(new RegExp('{'+p+'}','g'), d[p]);
return s;
}
t("Hello {who}! It's {time} ms since epoch.", { who: "JavaScript", time: Date.now });
// "Hello JavaScript! It's 1299680443046 ms since epoch."
View miva-module-basic-crud.xml
<MvFUNCTION NAME = "CRUD_Example_Read" PARAMETERS = "example var" STANDARDOUTPUTLEVEL = "">
<MvASSIGN NAME = "l.example:id" VALUE = "{ CRUD_Examples.d.id }">
<MvASSIGN NAME = "l.example:foo" VALUE = "{ CRUD_Examples.d.foo }">
<MvASSIGN NAME = "l.example:bar" VALUE = "{ CRUD_Examples.d.bar }">
<MvASSIGN NAME = "l.example:baz" VALUE = "{ CRUD_Examples.d.baz }">
</MvFUNCTION>
<MvFUNCTION NAME = "CRUD_Example_Load" PARAMETERS = "id, example var" STANDARDOUTPUTLEVEL = "">
View miva-get-variant-info-on-variant-change.js
// Copied from @RubenMarin's implimentation
// Add to existing cornerstoneUX.sharedFunctions object...
cornerstoneUX.sharedFunctions.getVariantInfoOnChangegetVariantInfoOnChange = function(fn) {
if (AttributeMachine instanceof Object) { //we first check if AttributeMachine is available
MivaEvents.SubscribeToEvent('variant_changed', function(product_data) {
let self = this;
setTimeout(function() {
let variantId = product_data.variant_id;
View miva-PROD-Attribute-Machine-generate-discount-savings-percent.html
<script>
AttributeMachine.prototype.Generate_Discount = function( discount )
{
var discount_div;
var msrp = Number(document.getElementById('price-value-additional').innerHTML.replace(/[\$,]/, '')),
savings_percent = Math.round(discount.discount / msrp * 100),
savings_percent_formatted = savings_percent + '%';
// console.log('Generate_Discount', discount, msrp, savings_percent, savings_percent_formatted );
View controller.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Sandbox extends CI_Controller {
public function __construct()
{
parent::__construct();
}
public function table_form($table, $id)