Skip to content

Instantly share code, notes, and snippets.

View trenkwill's full-sized avatar

William Hutter trenkwill

View GitHub Profile
@shafiimam
shafiimam / index.liquid
Last active August 27, 2023 05:04
Shopify selling plan product add to cart
<div class="productGrid__formItem">
{%- liquid
assign current_variant = product.selected_or_first_available_variant | default: product.variants.first
assign current_selling_plan_allocation = current_variant.selected_selling_plan_allocation
if current_selling_plan_allocation == nil and current_variant.requires_selling_plan
assign current_selling_plan_allocation = current_variant.selling_plan_allocations | first
endif
assign offer = current_selling_plan_allocation | default: current_variant
@kartick14
kartick14 / cart.liquid
Last active March 27, 2025 06:53
Apply discount code from cart page in shopify
<div class="discountcodefield">
<label for="discount">Discount Code:</label>
<input autocomplete="off" type="hidden" name="discount" class="discount_code" />
<input autocomplete="off" type="text" name="discount_code" class="discount_code_field" />
<input type="button" name="apply_discount_code" class="btn discount_code_btn" value="Apply"/>
</div>
<div class="cart__savings discount_apply_code">
</div>
@salcode
salcode / .gitignore
Last active December 10, 2024 15:31
See https://salferrarello.com/wordpress-gitignore/ for the latest version of my WordPress .gitignore file
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
@joyrexus
joyrexus / README.md
Last active May 16, 2025 01:54 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@JeffreyWay
JeffreyWay / .vimrc
Last active November 1, 2024 18:35
My .vimrc file
set nocompatible " Disable vi-compatibility
set t_Co=256
colorscheme xoria256
set guifont=menlo\ for\ powerline:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15
@ralphcrisostomo
ralphcrisostomo / Wordpress Localhost FTP Connection Information.md
Last active October 26, 2020 14:27
Bypass Wordpress Localhost FTP Connection Information

Bypass Wordpress Localhost FTP Connection Information

Do chown / chmod wordpress folder:

    $ sudo chown -R :_www wordpress
    $ sudo chmod -R g+w wordpress

Add the following line into wp-config.php:

@alexyoung
alexyoung / .vimrc
Created May 16, 2012 11:12
mouse-vimrc
" vim:fdm=marker
" Editor basics {{{
" Behave like Vim instead of Vi
set nocompatible
" Show a status line
set laststatus=2
" Show the current cursor position
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
@hlb
hlb / _Users_hlb_dev_path_menu_sass_app_scss_mixin
Created December 29, 2011 01:24
Compass.app auto complete
"adjust-font-size-to($to-size, $lines, $from-size)"
"adjust-leading-to($lines, $font-size)"
"alternating-rows-and-columns($even-row-color, $odd-row-color, $dark-intersection, $header-color, $footer-color)"
"appearance($ap)"
"apply-origin($origin, $only3d)"
"apply-side-rhythm-border($side, $width, $lines, $font-size, $border-style)"
"backface-visibility($visibility)"
"background($background-1, $background-2, $background-3, $background-4, $background-5, $background-6, $background-7, $background-8, $background-9, $background-10)"
"background-clip($clip)"
"background-image($image-1, $image-2, $image-3, $image-4, $image-5, $image-6, $image-7, $image-8, $image-9, $image-10)"
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active April 14, 2025 11:07
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh