Skip to content

Instantly share code, notes, and snippets.

View fatihtoprak's full-sized avatar
🎯
Focusing

Fatih Toprak fatihtoprak

🎯
Focusing
View GitHub Profile
@yasinkuyu
yasinkuyu / paribu_api
Last active June 5, 2025 21:43
Paribu Bitcoin Rates
Paribu.com - Türkiye'nin Bitcoin Borsası
2021 (update)
Api endpoint
https://v3.paribu.com/app/markets/btc-tl?interval=1000
Ticker
@cfaria
cfaria / migrateorders.php
Last active January 16, 2025 10:51 — forked from maddisondesigns/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.
@RadGH
RadGH / rs_upload_from_url.php
Last active June 23, 2025 17:51
Upload a file from a URL to the WordPress media gallery. Supports images, PDFs, and other file types.
<?php
/**
* This function uploads a file from a URL to the media library, designed to be placed in your own theme or plugin.
* Metadata will be generated and images will generate thumbnails automatically.
*
* HOW TO USE:
* 1. Add the function below to your theme or plugin
* 2. Call the function and provide the URL to an image or other file.
* 3. If successful, the attachment ID will be returned.
@davidsword
davidsword / wp-image-filters.php
Last active September 24, 2024 00:24
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 / remove_DS_store_files.md
Last active May 24, 2019 07:13
How to remove .DS_Store files.

Tüm DS_Store dosyalarını kaldırma

sudo crontab -e

Vi editor'da klavyenizden bir kez I harfine basın ve aşağıdaki komutu girin:

*/10 * * * * root find / -name ".DS_Store" -depth -exec rm {} \;

  • Bu crontab girişi aşağıdaki formata sahiptir:
@Oceas
Oceas / wds-hello-world.php
Last active June 2, 2023 10:03
WDS WP-CLI 101 Complete
<?php
/*
Plugin Name: WDS Hello World
Plugin URI: https://webdevstudios.com/
Description: Teaching the basics of WP-CLI
Author: Web Dev Studios
Version: 1.0.0
Author URI: https://webdevstudios.com/
*/
class WDS_CLI {
<?php
function ohub_cf7_handle_success_submission( $contact_form ) {
global $wpdb;
$title = $contact_form->title;
$submission = WPCF7_Submission::get_instance();
$table_name = $wpdb->prefix.'log_mail';
if ( $submission ) {
$posted_data = $submission->get_posted_data();
$wpdb->insert(
$table_name,
@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