Skip to content

Instantly share code, notes, and snippets.

View mghdotdev's full-sized avatar

Max Hegler mghdotdev

View GitHub Profile
@mghdotdev
mghdotdev / file_io.py
Created June 5, 2015 16:31
Python: File Read/Write
import re
def format_file(file1, file2):
output = re.sub(r'STUFF_TO_REPLACE', r'STUFF_TO_PUT_IN_PLACE', file1.read() )
file2.write(output)
format_file(open('input.txt', 'r'), open('output.txt', 'w'))
@mghdotdev
mghdotdev / CreditCardChecker.js
Last active September 24, 2015 23:21
Miva: Single Input Credit Card Checker
// ---- Credit Card Checker (No OPAY) ---- //
var CreditCardChecker = {
init: function (cc_input) {
this.cc = $(cc_input);
this.cc.keyup(function() {
$('.credit-card.highlighted-card').removeClass('highlighted-card');
this.check( $(this.cc).val() );
}.bind(this));
<mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:shippingmethods, ':price',1)" />
<mvt:comment>
<!--
Deprecated:
<mvt:item name="toolkit" param="asortmulti|l.all_settings:shippingmethods|:price|1" />
-->
</mvt:comment>