Skip to content

Instantly share code, notes, and snippets.

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

Ciprian Tepes cipriantepes

🏠
Working from home
View GitHub Profile
@PretzelJones
PretzelJones / elementaryOS_installation_script.sh
Last active May 21, 2018 14:15
Elementary OS Software Dev setup bash script
#!/bin/bash
#installation script for elementary OS Loki and most ubuntu 16.04 based OSs centered around Android and web development
#includes Android Studio and KVM for emulator configuration
#added installation of web development tools (nodejs,npm & bower packagemanagers, firebase & polymer)
#feel free to comment out any apps you wish not to install
#make executable and install via "chmod -x elementary-install-script.sh && ./elementary-install-script.sh"
#most of the install runs without any user interaction, but on occasion you must confrim installations
@frozonfreak
frozonfreak / function.php
Last active November 20, 2018 15:54
WooCommerce apply coupon for regular price instead of sale price
add_filter('woocommerce_coupon_get_discount_amount', 'woocommerce_coupon_get_discount_amount', 10, 5 );
function woocommerce_coupon_get_discount_amount( $discount, $discounting_amount, $cart_item, $single, $coupon ) {
if ($coupon->type == 'percent_product' || $coupon->type == 'percent') {
global $woocommerce;
$cart_total = 0;
foreach ( $woocommerce->cart->get_cart() as $cart_item_key => $cart_item ) {
$variable_product1= new WC_Product_Variation( $cart_item["variation_id"] );
@mohammadmursaleen
mohammadmursaleen / gist:9622098e43afdab6025e
Last active October 15, 2021 18:29
Adding custom fields above WOOCOMMERCE add to cart button
<?php
// To add custom data above add to cart button in woocommerce
// step 1
add_action('wp_ajax_wdm_add_user_custom_data_options', 'wdm_add_user_custom_data_options_callback');
add_action('wp_ajax_nopriv_wdm_add_user_custom_data_options', 'wdm_add_user_custom_data_options_callback');
function wdm_add_user_custom_data_options_callback()
@jaicab
jaicab / responsive-video.css
Last active July 29, 2023 02:52
Pure CSS solution for embed videos with an aspect ratio of 16:9
.video-container {
position: relative;
padding-bottom: 56.25%; /*16:9*/
padding-top: 30px;
height: 0;
overflow: hidden;
}
.video-container iframe,
.video-container object,
@WebEndevSnippets
WebEndevSnippets / style.css
Last active April 18, 2018 12:08
Gravity Forms: 4 Column CSS
/* 4 column Gravity Forms custom ready class ------------------------------------------------------*/
.gform_wrapper .top_label li.gfield.gf_first_quarter,
.gform_wrapper .top_label li.gfield.gf_second_quarter,
.gform_wrapper .top_label li.gfield.gf_third_quarter,
.gform_wrapper .top_label li.gfield.gf_fourth_quarter {
margin:0 0 8px 0;
width:24%;
}
@bitfade
bitfade / gist:4555047
Last active January 21, 2022 03:06
WordPress - Remove empty p tags for custom shortcodes
<?php
add_filter("the_content", "the_content_filter");
function the_content_filter($content) {
// array of custom shortcodes requiring the fix
$block = join("|",array("col","shortcode2","shortcode3"));
// opening tag