Skip to content

Instantly share code, notes, and snippets.

View amissak's full-sized avatar
🏠
Working from home

Abdi Issak amissak

🏠
Working from home
View GitHub Profile
<?php
/**
* Given a valid file location (it must be an path starting with "/"), i.e. "/css/style.css",
* it returns a string containing the file's mtime as query string, i.e. "/css/style.css?v=0123456789".
* Otherwise, it returns the file location.
*
* @param $file the file to be loaded.
*/
function auto_version($file) {
@williambsb
williambsb / ajaxify-cart.liquid
Created June 25, 2020 20:29
Cart Drawer - HC Shopify
<script>
/**
* Module to ajaxify all add to cart forms on the page.
*
* Copyright (c) 2015 Caroline Schnapp (11heavens.com)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
@winggundamth
winggundamth / wp-config.php
Created September 7, 2019 08:15
Wordpress Configuration to read from environment variables
<?php
/**
* The base configuration for WordPress
*
* The wp-config.php creation script uses this file during the
* installation. You don't have to use the web site, you can
* copy this file to "wp-config.php" and fill in the values.
*
* This file contains the following configurations:
*
@ashokmhrj
ashokmhrj / hooks.php
Last active January 17, 2024 16:04
WooCommerce mnicart qty update
<?php
add_action('woocommerce_widget_shopping_cart_before_buttons','ask_woo_mini_cart_before_buttons' );
function ask_woo_mini_cart_before_buttons(){
wp_nonce_field( 'woocommerce-cart' );
?>
<div class="submit-button">
<input type="submit" class="button" name="update_cart" value="<?php esc_attr_e('Uppdatera varukorg', 'tidymerch'); ?>"/>
</div>
<?php
@dmnsgn
dmnsgn / WebGL-WebGPU-frameworks-libraries.md
Last active July 23, 2024 14:54
A collection of WebGL and WebGPU frameworks and libraries

A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.

Engines and libraries ⚙️

Name Stars Last Commit Description
three.js ![GitHub
@jonathanmoore
jonathanmoore / gist:c0e0e503aa732bf1c05b7a7be4230c61
Last active January 17, 2024 21:47 — forked from carolineschnapp/gist:1083007
Linked options helper methods for Shopify. See this: http://docs.shopify.com/manual/configuration/store-customization/advanced-navigation/linked-product-options - Updated to work with sectioned themes (tested with District)
<script>
// (c) Copyright 2016 Caroline Schnapp. All Rights Reserved. Contact: mllegeorgesand@gmail.com
// See https://docs.shopify.com/themes/customization/navigation/link-product-options-in-menus
// Modified by Jonathan Moore (Style Hatch) https://github.com/jonathanmoore
/*
Updated to work with sectioned themes
- Added required methods from the deprecated options_selection.js
- Triggers an initial variant change
- Hides sold out variants with only one option
@veganista
veganista / file.liquid
Created April 20, 2016 10:56
Debugging Objects in Shopify Templates
<script>console.log({{ product | json }});</script>
@michaelaguiar
michaelaguiar / add-to-cart.js
Last active September 11, 2022 01:11
Woocommerce: Update Mini Cart on Ajax
// Update Mini Cart
$.post(
woocommerce_params.ajax_url,
{'action': 'mode_theme_update_mini_cart'},
function(response) {
$('#mode-mini-cart').html(response);
}
);
@joepie91
joepie91 / vpn.md
Last active July 24, 2024 06:18
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
@qutek
qutek / woocommerce-ajax.php
Last active May 27, 2024 16:04
[Wordpress] [Woocommerce] WooCommerce Ajax Handlers
<?php
/**
* WooCommerce Ajax Handlers
*
* Handles AJAX requests via wp_ajax hook (both admin and front-end events)
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/** Frontend AJAX events **************************************************/