Skip to content

Instantly share code, notes, and snippets.

View roeeyossef's full-sized avatar

Roee Yossef roeeyossef

View GitHub Profile
// 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' );
@roeeyossef
roeeyossef / css-grid-with-fixed-header.markdown
Created October 11, 2018 16:51
CSS Grid with Fixed Header
@roeeyossef
roeeyossef / dump-mamp-mysql-dbs.sh
Created May 24, 2018 12:39 — forked from salcode/dump-mamp-mysql-dbs.sh
Shell Script to dump all MAMP DBs into separate files
# based on http://www.commandlinefu.com/commands/view/2916/backup-all-mysql-databases-to-individual-files
# but modified for the MAMP path and to include default root/root as username and password
for I in $(/Applications/MAMP/Library/bin/mysql -u root -proot -e 'show databases' -s --skip-column-names); do /Applications/MAMP/Library/bin/mysqldump -u root -proot $I | gzip > "$I.sql.gz"; done
@roeeyossef
roeeyossef / gist:97abd616eadf0cafaf9c40b1a13e57ad
Created January 7, 2018 11:58
handles 360 panoramic images
<!-- JS -->
(function($){
$(document).ready(function () {
//call imagePanning fn when DOM is ready
$("#savvy_vr_visit img").imagePanning();
});
//imagePanning fn
$.fn.imagePanning = function () {
@roeeyossef
roeeyossef / gist:d862ce4e0190bc3ffe60
Created April 28, 2015 16:40
הצגת פוסטים אחרונים מקטגורייה מסוימת בוורדפרס
function my_post_by_category() {
// the query
$the_query = new WP_Query( array( 'category_name' => 'XXXXXX', 'posts_per_page' => 4 ) );
// The Loop
if ( $the_query->have_posts() ) {
$string .= '<ul class="postsbycategory widget_recent_entries">';
while ( $the_query->have_posts() ) {
$the_query->the_post();
if ( has_post_thumbnail() ) {
.video { position: relative; padding-bottom: 56.25%; /* 16:9 */ height: 0; }
.video img { position: absolute; display: block; top: 0; left: 0; width: 100%; height: 100%; z-index: 20; cursor: pointer; }
.video:after { content: ""; position: absolute; display: block;
background: url(play-button.png) no-repeat 0 0;
top: 45%; left: 45%; width: 46px; height: 36px; z-index: 30; cursor: pointer; }
.video iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
/* image poster clicked, player class added using js */
.video.player img { display: none; }
.video.player:after { display: none; }
// SmoothScroll for websites v1.2.1
// Licensed under the terms of the MIT license.
// People involved
// - Balazs Galambosi (maintainer)
// - Michael Herf (Pulse Algorithm)
(function(){
// Scroll Variables (tweakable)