Skip to content

Instantly share code, notes, and snippets.

View hayatbiralem's full-sized avatar

Ömür Yanıkoğlu hayatbiralem

View GitHub Profile
@hayatbiralem
hayatbiralem / String.toLatinFromTurkish.js
Created November 23, 2016 15:22
Bir metin içindeki Türkçe karakterleri Latin karakterlere dönüştürür.
if (typeof String.prototype.toLatinFromTurkish !== "function") {
String.prototype.toLatinFromTurkish = function() {
var string = this;
var letters = {
"Ğ":"G",
"Ü":"U",
"Ş":"S",
"İ":"I",
"Ö":"O",
"Ç":"C",
@hayatbiralem
hayatbiralem / cities-in-turkey--ordered-by-id.html
Last active March 7, 2023 13:09
List of cities in Turkey (HTML Select Option)
<!-- ordered by id -->
<select name="city">
<option value="">Choose...</option>
<option value="1">Adana</option>
<option value="2">Adıyaman</option>
<option value="3">Afyonkarahisar</option>
<option value="4">Ağrı</option>
<option value="5">Amasya</option>
<option value="6">Ankara</option>
<option value="7">Antalya</option>
@hayatbiralem
hayatbiralem / runcloud-hub.php
Created May 13, 2022 22:57
RunCloud Hub WPML Support
<?php
/**
* @wordpress-plugin
* Plugin Name: RunCloud Hub
* Description: RunCloud server-side caching for WordPress, Nginx FastCGI/Proxy Cache and Redis Object Cache
* Author: RunCloud
* Author URI: https://runcloud.io/
* Version: 1.2.1
* Requires at least: 4.9
* License: GPL-2.0 or later
@hayatbiralem
hayatbiralem / gist:eb25df49899cd1f97616ce72253724e0
Created July 14, 2021 09:07
Parse published (public) Google Spreadsheet HTML data into Javascript array
// Thanks to this gist: [Sample HTML/JS to parse a Google Spreadsheet](https://gist.github.com/terrywbrady/a03b25fe42959b304b1e)
var htmlEndPoint = 'https://docs.google.com/spreadsheets/d/e/2PACX-1vREXBtuL2uKofq9ufXsIlytbONUR0-q_tf1Ucm14JpeE5KAdry97CCwvivf3e5NkCAnZ1Xg4qYa0RCo/pubhtml';
(function($){
var parseHtmlTableToJson = function($table){
var data = [];
var $headers = $("tr:first-child td", $table);
var headers = [];
@hayatbiralem
hayatbiralem / parseGoogleSpreadsheetJsonIntoArray.js
Created July 14, 2021 08:34
Parse published (public) Google Spreadsheet JSON data into Javascript array
// Thanks to this gist: [Sample HTML/JS to parse a Google Spreadsheet](https://gist.github.com/terrywbrady/a03b25fe42959b304b1e)
var id = '1g3471DBNQEg0v_ByMBx1gNDx5cmlN5Ikn3f1DgJtQY8';
var jsonEndPoint = 'https://spreadsheets.google.com/feeds/cells/'+id+'/1/public/values?alt=json';
var parseGoogleSpreadsheetJsonIntoArray = function (response){
// Check the markup hasn't changed
if(response.feed && response.feed.entry && response.feed.entry[0] && response.feed.entry[0].gs$cell) {
var headings = [];
var data = [];
@hayatbiralem
hayatbiralem / filter_ct_template_archive_among_taxonomies.php
Last active July 11, 2021 21:39
WPML support for Oxygen Builder's taxonomy templates
<?php
function my_prefix_filter_ct_template_archive_among_taxonomies($metadata, $object_id, $meta_key, $single)
{
$meta_needed = 'ct_template_archive_among_taxonomies';
if (!is_admin() && isset($meta_key) && $meta_needed == $meta_key) {
remove_filter('get_post_metadata', 'my_prefix_filter_ct_template_archive_among_taxonomies', 100);
$current_meta = get_post_meta($object_id, $meta_needed, true);
add_filter('get_post_metadata', 'my_prefix_filter_ct_template_archive_among_taxonomies', 100, 4);
@hayatbiralem
hayatbiralem / wp-all-import-functions.php
Last active July 2, 2021 08:26
WP All Import helper functions
<?php
// WP All Import strip host from single image url
function reboot_strip_host_from_url_single($featured_image_url){
return str_replace('http://www.example.com/wp-content/', '', $featured_image_url);
}
// WP All Import strip host from image urls
function reboot_strip_host_from_url($featured_image_url, $content_image_urls){
$result = [];
@hayatbiralem
hayatbiralem / email.js
Last active April 13, 2021 23:14
Email PHP and jQuery Ajax Scripts for Webflow HTML Export with Google Recaptcha
(function ($) {
var Webflow = window.Webflow || [];
Webflow.push(function () {
// === Custom Form Handling ===
// unbind webflow form handling
$(document).off('submit');
// new form handling
@hayatbiralem
hayatbiralem / remove_noindex_category_posts_from_sitemap.php
Created March 1, 2021 07:49
Yoast WP Seo - How to remove noindex category posts from sitemap
<?php
if (!class_exists('myprefix_remove_noindex_category_posts_from_sitemap')) {
class myprefix_remove_noindex_category_posts_from_sitemap
{
function __construct()
{
add_action('wpseo_exclude_from_sitemap_by_post_ids', [$this, 'exclude']);
@hayatbiralem
hayatbiralem / index.php
Last active November 18, 2020 06:47
RunCloud default web app index.php to show a common maintenance page.
<?php
$app_name = $_SERVER['HTTP_HOST'];
$seo_title = $app_name;
$seo_description = 'This website is currently out of service!';
$body_message = $seo_description;
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily Unavailable');
header('Retry-After: 86400'); // 86400 seconds = 1 day