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
@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"]=>
@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
@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

@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"
)
@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".
**/
@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
@ahaywood
ahaywood / header.scss
Last active September 29, 2021 18:33
WordPress: Mega Menu
/*------------------------------------*\
#PRIMARY-MENU
\*------------------------------------*/
.primary-menu {
@include grid;
@include sans-serif;
font-weight: $bold;
height: $nav-bar-height;
&__wrapper {
@ahmadawais
ahmadawais / upload-a-file.MD
Created June 18, 2017 11:07 — forked from websupporter/upload-a-file.MD
Upload a file using the WordPress REST API

Upload files

Using the REST API to upload a file to WordPress is quite simple. All you need is to send the file in a POST-Request to the wp/v2/media route.

There are two ways of sending a file. The first method simply sends the file in the body of the request. The following PHP script shows the basic principle:

@seoagentur-hamburg
seoagentur-hamburg / .htaccess
Last active July 18, 2025 10:06
UPDATE 2024/03: Perfect .htaccess file for highspeed and security. You can use it for every WordPress-Website without problems. Highspeed and Security - testet on hundreds of Websites. If you are using a WordPress Multisite, change the last part of this file.
########################################################################
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2.0.9 - 03/2024
# ----------------------------------------------------------------------
# @Author: Andreas Hecht
# @Author URI: https://seoagentur-hamburg.com
# License: GNU General Public License v2 or later
# License URI: http://www.gnu.org/licenses/gpl-2.0.html
########################################################################
@steveosoule
steveosoule / .htaccess
Last active May 5, 2019 15:26
.htaccess - Web Performance
# ######################################################################
# BEGIN - WEB PERFORMANCE #
# https://github.com/h5bp/html5-boilerplate/blob/master/dist/.htaccess #
# ######################################################################
# ----------------------------------------------------------------------
# | Compression |
# ----------------------------------------------------------------------
<IfModule mod_deflate.c>