Skip to content

Instantly share code, notes, and snippets.

View serkanalgur's full-sized avatar
🇹🇷
🇦🇿 Selam / Salam / Hi!

Serkan Algur serkanalgur

🇹🇷
🇦🇿 Selam / Salam / Hi!
View GitHub Profile
@nunomorgadinho
nunomorgadinho / gist:b2d8e5b8f5fec5b0ed946b24fa288a91
Created February 10, 2017 13:30
PHPCS + WordPress Coding Standards
# Install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install composer
brew install homebrew/php/composer
### PHPCS
composer global require "squizlabs/php_codesniffer=*"
# Add to your .bash_profile
@obiPlabon
obiPlabon / vc-parent-child-communication.js
Last active December 12, 2019 11:07
Parent to child and child to parent (bidirectional) communication in Visual Composer shortcode
/**
NOTES:
========================
0. Extend container view from "VcColumnView" so that you get a clean UI.
1. Render method called after element is added (cloned), and on first initalization.
2. Use model.getParam(param_name) to get specific param from params.
3. Use model.get("params") to get complete params object.
4. If params is changed then shortcode will be rendered automatically.
5. You do not need to override method that you are not going change, in our file "render".
**/
@inotnako
inotnako / server.go
Last active August 29, 2023 11:38
get meta from html page
package main
import (
"encoding/json"
"net/http"
"net/url"
"golang.org/x/net/html"
"io"
)
@mikoim
mikoim / README.md
Last active March 30, 2025 06:04
[Updated! Aug 14 2020] YouTube recommended encoding settings on ffmpeg (+ libx264)

Parameters

Container: MP4

Parameter YouTube recommends setting
-movflags faststart moov atom at the front of the file (Fast Start)

Video codec: H.264

@neamtua
neamtua / woocommerce_update_shipping_costs.php
Created September 8, 2016 06:13
WooCommerce: Update shipping costs on checkout using ajax
<script type="text/javascript">
/* in order to update info on your checkout page you need to trigger update_checkout function
so add this in your javascript file for your theme or plugin
*/
jQuery('body').trigger('update_checkout');
/* what this does is update the order review table but what it doesn't do is update shipping costs;
the calculate_shipping function of your shipping class will not be called again;
so if you were like me and you made a shipping method plugin and you had to change costs based on payment method then
@igorbenic
igorbenic / dump.txt
Last active June 29, 2022 08:15
How to Create a WordPress Custom Menu with Nav Walker Class | www.ibenic.com/how-to-create-a-wordpress-custom-menu-with-walker-nav-menu-class
object(WP_Post)#497 (40) {
["ID"]=>
int(160)
["post_author"]=>
string(1) "1"
["post_date"]=>
string(19) "2016-03-26 17:59:07"
["post_date_gmt"]=>
string(19) "2016-03-26 17:59:07"
["post_content"]=>
@molotovbliss
molotovbliss / pagespeed.conf
Created August 12, 2016 19:55
mod_pagespeed.conf for Magento 1.x
<IfModule mod_pagespeed>
# General Configuration
ModPagespeed on
ModPagespeedDomain *.domain.com
ModPagespeedDomain images.domain.com
ModPagespeedDomain assets.domain.com
ModPagespeedStatistics on
ModPagespeedStatisticsLogging on
ModPagespeedLogDir /home/domain.com/public_html/var/pagespeed
@stormwild
stormwild / woocommerce-create-order.md
Last active October 28, 2024 06:17
WooCommerce Creating Order Programmatically

WooCommerce Creating Order Programmatically

WooCommerce Create Order

creating Woocommerce order with line_item programatically

// http://stackoverflow.com/questions/26581467/creating-woocommerce-order-with-line-item-programatically
$address = array(
            'first_name' => 'Fresher',
@tabrindle
tabrindle / webp-convert-directory.sh
Last active April 16, 2025 15:25
Convert all files in directory to webp, with default params, or standard cwebp params passed from command
#!/bin/bash
PARAMS=('-m 6 -q 70 -mt -af -progress')
if [ $# -ne 0 ]; then
PARAMS=$@;
fi
cd $(pwd)
// Shortcode
// source : https://wpbakery.atlassian.net/wiki/pages/viewpage.action?pageId=524362
if(!function_exists('carousel_content')){
function carousel_content( $atts, $content = null ) {
return '<div class="owl-carousel content-carousel content-slider">'.do_shortcode($content).'</div>';
}
add_shortcode('carousel_content', 'carousel_content');
}