Skip to content

Instantly share code, notes, and snippets.

View bulentsakarya's full-sized avatar
🎯
Focusing

Bülent Sakarya bulentsakarya

🎯
Focusing
View GitHub Profile
@bulentsakarya
bulentsakarya / gist:21bc5647c2a754fc8c163c9231922c0e
Created July 1, 2024 19:24 — forked from thatguynef/gist:c68452cc2cf31d112b9ba6d76911ae1d
Tutorial - Google Places API Autocomplete Library
// See tutorial video https://youtu.be/qpUfj4zPxWQ
// Google Dev Docs: https://developers.google.com/maps/documentation/javascript/places
// Insert this script in the <head> element
<script async
src="https://maps.googleapis.com/maps/api/js?key=API_KEY&libraries=places&callback=initMap">
</script>
//Insert this script before the closing body tag </body>
<script>

This is a simple instruction to use Tabler in your next Laravel project.

(Tabler is a beautiful dashboard: https://tabler.io/)

How to install:

  1. first of all run content of gistfile1.txt in your Laravel project.
  2. Copy tabler.js to recourses/js.
  3. Copy tabler.scss to resources/sass.
  4. Replace webpack.mix.js with your current webpack.mix.js
@bulentsakarya
bulentsakarya / woocommerce-tr-fields.php
Created April 14, 2020 03:14 — forked from harslannet/woocommerce-tr-fields.php
Woocommerce ödeme sayfasında bireysel müşteriler için T.C. numarası kurumsal müşteriler için vergi numarası alanını ekleme.
<?php
/*
* Çalışma koşulu şu şekilde;
* Ödeme ekranına geldiğinde müşteri varsayılan olarak T.C. alanını görecek ama araştırdığım ve öğrendiğim kadarıyla sadece 5000 TL ve üstü siparişler için T.C. numarası zorunluymuş bu yüzden zorunlu olmayacak.
* Zorunlu olmamasına rağmen eğer müşteri buraya yanlış bir T.C. yazarsa doğrulamadan geçecek ve eğer yazmak istemiyorsa boş bırakması için uyarı mesajı gelecek
* Eğer firma adına fatura isterse Kurumsal Sipariş Checkbox'ını işaretleyerek T.C. alanı gizlenecek ve vergi dairesi ile vergi numarası alanı gözükecek ve bu alanlar zorunlu olacak
* Not: T.C. numarası ve Vergi Numarası doğrulamadan geçiyor.
* Eksikler: T.C. Numarasını boş bırakabildikleri için veri tabanına o sipariş için 11111111111 yazdırmayı başaramadım. ->
* Ama 147. satırdaki kod sipariş ekranında bu bilgiyi gösteriyor, bunu nasıl yaparız bilen varsa yazsın ->
* Aslında 'default' => 11111111111 ile veritabanına bunu yazdırabilirim ama bunu set edince sipariş ekranında bu numaranın gözükmesi hoşuma git
@bulentsakarya
bulentsakarya / form.php
Created March 13, 2020 14:43 — forked from kharakhordindemo/form.php
Remove span in Contact Form 7
/*Contact form 7 remove span*/
add_filter('wpcf7_form_elements', function($content) {
$content = preg_replace('/<(span).*?class="\s*(?:.*\s)?wpcf7-form-control-wrap(?:\s[^"]+)?\s*"[^\>]*>(.*)<\/\1>/i', '\2', $content);
$content = str_replace('<br />', '', $content);
return $content;
});
<hr />
<div class="row">
<div class="col-md-4">
[text* your-name class:form-control placeholder "Name (required)"]
</div>
<div class="col-md-4">
[email* your-email class:form-control placeholder "Email (required)"]
@bulentsakarya
bulentsakarya / woocommerce-disable-payment.php
Last active November 29, 2019 20:28 — forked from corsonr/functions.php
WooCommerce: disable payments on checkout page
<?php // Do not include this if already open! Code goes in theme functions.php.
// Disable all payment gateways on the checkout page and replace the "Pay" button by "Place order"
add_filter( 'woocommerce_cart_needs_payment', '__return_false' );
@bulentsakarya
bulentsakarya / like-it-enqueue.php
Created August 10, 2019 16:00 — forked from shizhua/like-it-enqueue.php
Add a like button without a plugin in WordPress
add_action( 'wp_enqueue_scripts', 'pt_like_it_scripts' );
function pt_like_it_scripts() {
if( is_single() ) {
wp_enqueue_style( 'like-it', trailingslashit( plugin_dir_url( __FILE__ ) ).'css/like-it.css' );
if (!wp_script_is( 'jquery', 'enqueued' )) {
wp_enqueue_script( 'jquery' );// Comment this line if you theme has already loaded jQuery
}
wp_enqueue_script( 'like-it', trailingslashit( plugin_dir_url( __FILE__ ) ).'js/like-it.js', array('jquery'), '1.0', true );
@bulentsakarya
bulentsakarya / kinsta-share-users.php
Created December 18, 2018 14:10 — forked from carlodaniele/kinsta-share-users.php
A plugin to share users and usermeta tables between independent WordPress installations. This plugin requires CUSTOM_USER_TABLE and CUSTOM_USER_META_TABLE defined into wp-config file
<?php
/**
* @package Kinsta_Share_Users
* @version 1.0
*/
/*
Plugin Name: Kinsta Share Users
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin for Kinsta blog readers
Author: Carlo Daniele
@bulentsakarya
bulentsakarya / gist:931a5a953a94cbc9327468fff11e812c
Created October 23, 2018 13:25 — forked from Marian0/gist:4d689c33164bc9daf0e1
Disable wordpress Frontend by htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !/wp-admin
RewriteCond %{REQUEST_URI} !/wp-includes
RewriteCond %{REQUEST_URI} !/wp-login\.php$
RewriteCond %{REQUEST_URI} !/wp-content
RewriteCond %{REQUEST_URI} !/feed
@bulentsakarya
bulentsakarya / wp-chosen-tax-metabox.php
Created August 29, 2017 19:34 — forked from helen/wp-chosen-tax-metabox.php
Use Chosen for a replacement WordPress taxonomy metabox
<?php
/**
* WordPress Chosen Taxonomy Metabox
* Author: Helen Hou-Sandi
*
* Use Chosen for a replacement taxonomy metabox in WordPress
* Useful for taxonomies that aren't changed much on the fly and are
* non-hierarchical in nature, as Chosen is for flat selection only.
* You can always use the taxonomy admin screen to add/edit taxonomy terms.
* Categories need slightly different treatment from the rest in order to