Skip to content

Instantly share code, notes, and snippets.

View gil--'s full-sized avatar
๐Ÿ’š
Building @ Shopify

Gil Greenberg gil--

๐Ÿ’š
Building @ Shopify
View GitHub Profile
@soomtong
soomtong / summernote.php
Last active March 2, 2022 12:14
(deprecated) summernote example with php
<!-- this version of sample is too old. it's not follow recent version of summernote api -->
<!-- should check new apis and examples! sorry I am. -->
<!DOCTYPE html>
<html lang="en">
<!-- include libries(jQuery, bootstrap, fontawesome) -->
<script src="//code.jquery.com/jquery-1.9.1.min.js"></script>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.no-icons.min.css" rel="stylesheet">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css" rel="stylesheet">
// Get The Page ID You Need
get_option( 'woocommerce_shop_page_id' );
get_option( 'woocommerce_cart_page_id' );
get_option( 'woocommerce_checkout_page_id' );
get_option( 'woocommerce_pay_page_id' );
get_option( 'woocommerce_thanks_page_id' );
get_option( 'woocommerce_myaccount_page_id' );
get_option( 'woocommerce_edit_address_page_id' );
get_option( 'woocommerce_view_order_page_id' );
get_option( 'woocommerce_terms_page_id' );
@corny
corny / git.cap
Created November 14, 2013 01:31
Capistrano 3 with Git Submodules
# Save this file as lib/capistrano/tasks/git.cap
namespace :git do
desc 'Copy repo to releases'
task create_release: :'git:update' do
on roles(:all) do
with fetch(:git_environmental_variables) do
within repo_path do
execute :git, :clone, '-b', fetch(:branch), '--recursive', '.', release_path
end
@msurguy
msurguy / List.md
Last active September 15, 2026 10:14
List of open source projects made with Laravel

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):

@marekmurawski
marekmurawski / laravel-optgroup.php
Last active January 8, 2018 12:32
Laravel macro Form::select() with optgroup based on Collection field
<?php
// You can put this code into /app/routes.php for testing
/*
* Form::selectOpt()
*
* Parameters:
* $collection A I\S\Collection instance
* $name The HTML "name"
* $groupBy Field by which options are grouped
@codearachnid
codearachnid / wc_customer_bought_product.php
Created February 27, 2014 21:07
WooCommerce check if user has already bought product.
<?php
// if product is already in global space
global $product;
// or fetch product attributes by ID
if( empty( $product->id ) ){
$wc_pf = new WC_Product_Factory();
$product = $wc_pf->get_product($id);
}
@thagxt
thagxt / Magento How to get the customer login, logout, register and checkout urls.php
Created April 23, 2014 12:10
Magento How to get the customer login, logout, register and checkout urls
login url
<?php echo Mage::getUrl('customer/account/login'); ?>
logout url
<?php echo Mage::getUrl('customer/account/logout'); ?>
My Account url
<?php echo Mage::getUrl('customer/account'); ?>
Register url
@whatnickcodes
whatnickcodes / magical.css
Created April 23, 2014 15:30
Video Hover Play - Probably could be more elegant...
/* Make Container Relative */
.video-wrapper {
position: relative;
}
/* Position the pause/play buttons in corner */
.video-icon-item {
font-family: "FontAwesome"; /* Font Awesome HTML Entity Trick verus using <i class="fa fa-play"></i> */
position: absolute;
right: 20px;
@zakhardage
zakhardage / Shopify Cart Permalink
Last active December 11, 2018 20:05
Shopify Cart Permalink
@dominikwilkowski
dominikwilkowski / shop.js
Last active October 27, 2021 16:12
Convert variant dropdown into swatches, multiple-option-sollution
/**************************************************************| CONVERT VARIANT TO SWATCHES |*/
$(function() {
if($(".single-option-selector").length) {
$(".single-option-selector").each(function(i) {
var $thisSelect = $(this);
var $newClass = "js-option-selector-" + i;
var $newOptions = '<ul class="new-variant-swatchs">';
var $currentOption = $thisSelect.val();