Skip to content

Instantly share code, notes, and snippets.

@steveosoule
steveosoule / wget--crawl.sh
Created May 31, 2017 17:05
Wget - Options & Sample Crawler
#!/bin/sh
# wget --mirror --adjust-extension --page-requisites --execute robots=off --wait=30 --rand om-wait --convert-links --user-agent=Mozilla http://www.example.com
### V1
# wget \
# --recursive \
# --no-clobber \
# --page-requisites \
# --html-extension \
@steveosoule
steveosoule / miva-add-remove-basket-charge.xml
Last active April 10, 2024 22:07
Miva - Add & Remove Basket Charges
<mvt:if expr="g.Delete_Charge">
<h2>Delete Charge</h2>
<mvt:do file="g.Module_Library_DB" name="l.gone" value="BasketCharge_Delete_All_Type(g.Basket:basket_id, 'CUSTOM_CHARGE')" />
</mvt:if>
<mvt:if expr="g.Add_Charge">
<mvt:assign name="l.basket_charge:basket_id" value="g.Basket:basket_id" />
<mvt:assign name="l.basket_charge:module_id" value="0" />
<mvt:assign name="l.basket_charge:type" value="'CUSTOM_CHARGE'" />
@steveosoule
steveosoule / 01__miva-user-friendly-date-time-with-am-pm.md
Last active February 27, 2024 18:05
Miva - User Friendly Date & Time with AM/PM (ex MM/DD/YYYY HH:MM AM/PM)

Miva - User Friendly Date & Time with AM/PM

The following code snippet will output a date with a format like this pattern:

MM/DD/YYYY HH:MM (AM/PM)

For example:

@steveosoule
steveosoule / UMD-sample.js
Created February 23, 2018 16:08
UMD Sample JS
// https://github.com/umdjs/umd
// https://css-tricks.com/gotchas-publishing-modules-npm-bower/
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['dependency'], factory);
} else if (typeof module === 'object' && module.exports) {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
@steveosoule
steveosoule / miva-domain-setting-variables.md
Last active January 18, 2024 16:52
Miva - Domain Setting Variables
Name Submit Variable Front End Variable Default
Root Directory for Graphics g.Domain_ImageRoot g.domain:image_root /mm5/
Secure Root Directory for Graphics g.Domain_SecureBaseURL g.domain:img_sroot, g.imageroot /mm5/
Base URL for Graphics g.Domain_BaseURL g.domain:base_url, g.baseurl http://www.example.com/mm5/
Secure Base URL for Graphics g.Domain_SecureBaseURL g.domain:base_surl, g.secure_baseurl, g.basehref https://www.example.com/mm5/
@steveosoule
steveosoule / Nework_throttling_profiles.md
Created January 12, 2024 18:27 — forked from theodorosploumis/Nework_throttling_profiles.md
Web development - Custom network throttling profiles
Profile download (kb/s) upload (kb/s) latency (ms)
Native 0 0 0
GPRS 50 20 500
56K Dial-up 50 30 120
Mobile EDGE 240 200 840
2G Regular 250 50 300
2G Good 450 150 150
3G Slow 780 330 200
@steveosoule
steveosoule / shadows-breakpoints.md
Last active December 19, 2023 16:07
Shadows Breakpoints
Breakpoint Name Device Min Pixels Max Pixels Min Em Max Em
Extra-Small Mobile (Small) 0 639.98 0 39.999
Small Mobile (Large) 640 767.98 40 47.999
Medium Tablet 768 959 48 59.999
Large Laptop 960 1199.98 60 74.999
Extra-Large Laptop (Large) 1200 1439.98 75 89.999
Wide-Screen Wide Screen 1440 Infinity 90 Infinity
@steveosoule
steveosoule / miva-token-list-in-js.html
Last active November 29, 2023 21:11
Miva - Token List in JSON
<script>
var miva_variables = {
"l": {
<mvt:assign name="l.settings:varlist__local" value="miva_array_deserialize( miva_getvarlist( 'l' ) )" />
<mvt:foreach iterator="var__local" array="varlist__local">
"&mvtj:var__local;": <mvt:do file="g.Module_JSON" name="l.success" value="JSON_Output( miva_variable_value( 'l.' $ l.settings:var__local ) )" />
<mvt:if expr="l.pos1 NE miva_array_elements( l.settings:varlist__local )">
,
</mvt:if>
</mvt:foreach>
@steveosoule
steveosoule / miva-get-full-url-of-current-page.xml
Created November 28, 2023 21:23
Miva - get full URL of current page
<mvt:do file="g.Module_Feature_URI_DB" name="l.success" value="URISettings_Load_Cached( l.uri_settings )" />
<mvt:do file="g.Module_Feature_URI_UT" name="l.settings:request_url" value="URL_Build_URI( l.uri_settings, l.flags, s.request_uri, '' )" />
&mvt:request_url;
@steveosoule
steveosoule / miva-mvt-call-and-get-the-content-length-header.xml
Created November 28, 2023 16:09
Miva - mvt:call and get the Content-Length header
<mvt:call action="'https://www.example.com'" method="'GET'">
<mvt:assign name="l.settings:headers" value="s.callreturnheader" />
</mvt:call>
<mvt:foreach iterator="header" array="headers">
<mvt:if expr="'Content-Length:' IN l.settings:header EQ 1">
<mvt:assign name="l.found" value="miva_splitstring( l.settings:header, ':', l.header_parts, 'trim' )" />
<mvt:assign name="l.content_length" value="l.header_parts[2]" />
</mvt:if>
</mvt:foreach>