Skip to content

Instantly share code, notes, and snippets.

View buraksahin59's full-sized avatar
:atom:
React Native

Burak buraksahin59

:atom:
React Native
View GitHub Profile
@buraksahin59
buraksahin59 / rs_upload_from_url.php
Created August 11, 2023 12:18 — forked from RadGH/rs_upload_from_url.php
Upload a file from a URL to the WordPress media gallery. Supports images, PDFs, and other file types.
<?php
/**
* This function uploads from a URL.
* To upload from a local file path instead
* @see: https://gist.github.com/RadGH/3b544c827193927d1772
*
* Example usage: Upload photo from URL, display the attachment as as html <img>
* $attachment_id = rs_upload_from_url( "http://example.com/images/photo.png" );
* echo wp_get_attachment_image( $attachment_id, 'large' );
@buraksahin59
buraksahin59 / functions.php
Last active July 5, 2023 11:13
WordPress Kategori Linkini Kaldırma. Detaylı anlatım için temapazari.com'u ziyaret edin: https://temapazari.com/blog/wordpress-kategori-linkini-kaldirma-5-yontem
<?php
// ... Üst bölümde functions.php'deki kodlarınız yer alıyor
function temapazari_remove_category( $string, $type ) {
if ( $type != 'single' && $type == 'category' && ( strpos( $string, 'category' ) !== false ) ) {
$url_without_category = str_replace( "/category/", "/", $string );
return trailingslashit( $url_without_category );
}
return $string;
@buraksahin59
buraksahin59 / backdrop-filter-support.css
Created February 23, 2021 08:39
Check backdrop-filter support
/* slightly transparent fallback */
.backdrop-blur {
background-color: rgba(255, 255, 255, .9);
}
/* if backdrop support: very transparent and blurred */
@supports ((-webkit-backdrop-filter: blur(2em)) or (backdrop-filter: blur(2em))) {
.backdrop-blur {
background-color: rgba(255, 255, 255, .5);
-webkit-backdrop-filter: blur(2em);
@buraksahin59
buraksahin59 / slick.js
Created February 10, 2021 20:43
slick.js for JavaScript
/*
_ _ _ _
___| (_) ___| | __ (_)___
/ __| | |/ __| |/ / | / __|
\__ \ | | (__| < _ | \__ \
|___/_|_|\___|_|\_(_)/ |___/
|__/
Version: 0.1.0
Original Author: Ken Wheeler

Codestar Framework

A Lightweight and easy-to-use WordPress Options Framework. It is a free framework for building theme options. Save your time!

Screenshot

Codestar Framework Screenshot

Read the documentation for details documentation

Installation

If you want a git repository to ignore permission changes (chmod),

type the following command into the Terminal while inside the git repository:

git config core.filemode false

It is usually possible to do this for all git repositories at once, instead of going one-by-one.

This is done by using the following command inside the Terminal (no need to be inside a git repository for this command):

@buraksahin59
buraksahin59 / creative-cloud-disable.md
Last active July 23, 2020 07:47
disable creative cloud startup on mac

It is loaded by default by /Library/LaunchAgents/com.adobe.AdobeCreativeCloud.plist.

Step 1

Run to edit plist file: code /Library/LaunchAgents/com.adobe.AdobeCreativeCloud.plist

Change to false given below;

--onOSstartup=false

@buraksahin59
buraksahin59 / ip_in_range.php
Created May 28, 2020 12:35 — forked from tott/ip_in_range.php
php check if IP is in given network range
/**
* Check if a given ip is in a network
* @param string $ip IP to check in IPV4 format eg. 127.0.0.1
* @param string $range IP/CIDR netmask eg. 127.0.0.0/24, also 127.0.0.1 is accepted and /32 assumed
* @return boolean true if the ip is in this range / false if not.
*/
function ip_in_range( $ip, $range ) {
if ( strpos( $range, '/' ) == false ) {
$range .= '/32';
}
@buraksahin59
buraksahin59 / bootstrap4-grid.css
Created April 22, 2020 09:13
Bootstrap 4 Grid Css
/*!
* Bootstrap Grid v4.3.1 (https://getbootstrap.com/)
* Copyright 2011-2019 The Bootstrap Authors
* Copyright 2011-2019 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
html {
box-sizing: border-box;
-ms-overflow-style: scrollbar;
}
@buraksahin59
buraksahin59 / wordpress_remote_images
Created March 16, 2020 09:34 — forked from bjorn2404/wordpress_remote_images
WordPress load remote images if they don't exist on the local development server htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/wp-content/uploads/(.*)$
RewriteCond %{DOCUMENT_ROOT}/wp-content/uploads/%1 !-f
RewriteRule ^wp-content/uploads/(.*)$ http://www.remotesite.com/wp-content/uploads/$1 [R=301,L]
</IfModule>