Skip to content

Instantly share code, notes, and snippets.

View VizualAbstract's full-sized avatar
📸
Haters will say this is Photoshopped

Corey Matthew Capetillo VizualAbstract

📸
Haters will say this is Photoshopped
View GitHub Profile
@VizualAbstract
VizualAbstract / frontend_notes.md
Last active September 25, 2018 16:49
Des and Frontend notes
function getProductForm(product_id) {
var forms = document.querySelectorAll('[action^="/cart/add"]');
if (!forms.length) {
alert('ReCharge cannot load: Product form not found.');
return false;
} else if (forms.length > 1) {
var product_form;
forms.forEach(function(form, i) {
if (form[i] && form[i].getAttribute('data-productid') !== null) {
if (form[i].getAttribute('data-productid') == product_id) {
<script>
(function() {
var ReCharge = {}
ReCharge.delay = 1;
ReCharge.listener_delay = 1;
ReCharge.product_id = {{ product.id }};
ReCharge.subscription_id = {{ subscription_id }};
ReCharge.subscription_only = {{ subscription_only }};
ReCharge.subscription_first = {{ select_subscription_first }};
ReCharge.default_purchase_type = '{{ default_purchase_type }}';
@VizualAbstract
VizualAbstract / 0_reuse_code.js
Created October 27, 2016 16:24
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@VizualAbstract
VizualAbstract / hideaddrbar.js
Created March 15, 2012 01:56 — forked from scottjehl/hideaddrbar.js
Normalized hide address bar for iOS & Android
/*
* Normalized hide address bar for iOS & Android
* (c) Scott Jehl, scottjehl.com
* MIT License
*/
(function( win ){
var doc = win.document;
// If there's a hash, or addEventListener is undefined, stop here
if( !location.hash && win.addEventListener ){