Skip to content

Instantly share code, notes, and snippets.

View fatihtoprak's full-sized avatar
🎯
Focusing

Fatih Toprak fatihtoprak

🎯
Focusing
View GitHub Profile
@fatihtoprak
fatihtoprak / wp-image-filters.php
Created January 15, 2023 22:20 — forked from davidsword/wp-image-filters.php
WordPress - All filters to modify an images URL (as far as I could find)
<?php
// Images in post galleries
add_filter( 'get_post_galleries', '_img_url_filter', PHP_INT_MAX );
add_filter( 'widget_media_image_instance', '_img_url_filter', PHP_INT_MAX );
// Core image retrieval
add_filter( 'image_downsize', '_img_url_filter', 10, 3 );
// Responsive image srcset substitution
@fatihtoprak
fatihtoprak / migrateorders.php
Created October 8, 2020 20:57 — forked from cfaria/migrateorders.php
Migrate WooCommerce Orders
<?php
//increase max execution time of this script to 150 min:
ini_set('max_execution_time', 9000);
//increase Allowed Memory Size of this script:
ini_set('memory_limit','960M');
// Copies woocommerce orders and users over from source to target.
// I use this on my local machine - loading both db's up there side by side
// could easily adjust the connect strings to connect elsewhere if needed.
@fatihtoprak
fatihtoprak / il_ilce_enlem_boylam.sql
Created September 20, 2018 22:35 — forked from ismailbaskin/il_ilce_enlem_boylam.sql
Türkiye İl ve İlçelerin enlem boylam bilgileri
/*
Türkiye İl ve İlçelerin enlem boylam bilgileri (dörtgen olarak sınır pozisyonlarıyla birlikte) kaynak : google maps (başarsoft)
twitter : http://twitter.com/tserpico
*/
DROP TABLE IF EXISTS `pk_il`;
CREATE TABLE `pk_il` (
`il_id` int(2) NOT NULL COMMENT 'plaka kodu',
`il_adi` varchar(255) NOT NULL,
`lat` double(20,8) DEFAULT NULL COMMENT 'enlem',
@fatihtoprak
fatihtoprak / FacebookDebugger.php
Created January 20, 2018 17:54 — forked from FrostyX/FacebookDebugger.php
Facebook API - Force facebook to reload cache from your website
<?php
class FacebookDebugger
{
/*
* https://developers.facebook.com/docs/opengraph/using-objects
*
* Updating Objects
*
* When an action is published, or a Like button pointing to the object clicked,
* Facebook will 'scrape' the HTML page of the object and read the meta tags.
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* WordPress Replace Image URL
*
* Replaces image url content of the WordPress post content.
*
* PHP version 5
* WordPress version 3.5
@fatihtoprak
fatihtoprak / clear_macos_icon_cacke_and_reload_dock.sh
Last active March 4, 2017 06:07 — forked from fabiofl/gist:5873100
Clear Mac OS X's icon cache. And Reload Dock
sudo find /private/var/folders/ -name com.apple.dock.iconcache -exec rm {} \;
killall "Dock"
@fatihtoprak
fatihtoprak / 0_reuse_code.js
Created December 13, 2016 18:28
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@fatihtoprak
fatihtoprak / strpos.php
Created January 9, 2016 02:18 — forked from hassanjamal/strpos.php
PHP : strpos recursive function
<?php
$mystring = 'welcome !! we are learning now string function';
$findme = 'learning';
$pos = strpos($mystring, $findme);
if ($pos === false) {
echo "The string '$findme' was not found in the string '$mystring'";
} else {
echo "The string '$findme' was found in the string '$mystring'"."\n";