Skip to content

Instantly share code, notes, and snippets.

View andrew-serrano's full-sized avatar

Andrew Serrano andrew-serrano

View GitHub Profile
@andrew-serrano
andrew-serrano / miva_image_resize_generator_single.xml
Created May 22, 2019 22:30
Script is used to resize a single image to a specific dimension. Used for a google product feed.
<mvt:comment> <mvt:assign name="g.Product_Code" value="'34072'" /> </mvt:comment>
<mvt:comment>
***
Image Resizer - Start
***
Image resizer is being used for google product feed form.
</mvt:comment>
<mvt:comment> Load Single Product </mvt:comment>
<mvt:do file="g.Module_Library_DB" name="l.success" value="Product_Load_Code(g.Product_Code, l.settings:product)" />
@andrew-serrano
andrew-serrano / miva_image_resize_generator_delete.xml
Created May 22, 2019 22:29
Used to delete google image type photos on products.
<mvt:comment> Redirect URL </mvt:comment>
<mvt:assign name="g.url" value="glosub( g.domain:base_surl, 'mm5/', '' ) $ 'delete-product-images'" />
<mvt:comment>
***
Image Deleter - Start
***
Image Deleter is being used for google product feed form.
</mvt:comment>
@andrew-serrano
andrew-serrano / miva_image_resize_generator.xml
Created May 22, 2019 22:28
Script is used to resize images to a specific dimension. Used for a google product feed.
<mvt:comment> Debug Helper Functions </mvt:comment>
<mvt:assign name="l.tab" value="asciichar( 9 )" />
<mvt:assign name="l.line_feed" value="asciichar( 10 )" />
<mvt:do file="g.Module_Library_Utilities" name="l.timestamp" value="Timestamp_ISO8601(s.time_t)" />
<mvt:comment> Redirect URL </mvt:comment>
<mvt:assign name="g.url" value="glosub( g.domain:base_surl, 'mm5/', '' ) $ 'generate-product-images'" />
<mvt:comment> Debug Log Vars </mvt:comment>
<mvt:assign name="l.debug_log_path" value="'/google_product_feed_image_generator_log.txt'" />
<mvt:comment>
Bitwise Operators
MDN:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators#(Bitwise_NOT)
MivaScript:
http://www.mivascript.com/topic/operators.html
</mvt:comment>
<mvt:comment>
Negative -> Positive
@andrew-serrano
andrew-serrano / load_readytheme_render_template.xml
Created April 1, 2019 20:14
Load ReadyTheme Content and Render Template
<mvt:comment>
Load information
</mvt:comment>
<mvt:item name="readytheme" param="Load_ContentSection( 'prod_video_now_playing', l.all_settings:ready_theme:content_sections:prod_video_now_playing)" />
<mvt:comment>
Return file
</mvt:comment>
<mvt:do name="l.return" file="g.Module_Feature_TUI_DB" value="ManagedTemplate_Load_ID( l.settings:ready_theme:content_sections:prod_video_now_playing:templ_id, l.settings:ready_theme:content_sections:prod_video_now_playing:template)" />
@andrew-serrano
andrew-serrano / jwt_token.xml
Last active June 5, 2018 18:06
Creating a JSON Web Token in Miva
<mvt:comment>
JWT Resource:
https://dev.to/robdwaller/how-to-create-a-json-web-token-using-php-3gml
JWT Debugging:
https://jwt.io/
JWT Example:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImV4YW1wbGVAbWl2YS5jb20iLCJhdXRoX2lkIjoxMjM0fQ.pVbu7ymUbbBwy5kUZGLNkYkgZHALpNbbtS718G-C6wo
</mvt:comment>