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 / country-codes-with-locales.json
Created June 29, 2020 18:36
Country Codes with Locales
[
{
"country": "AD",
"en_name": "Andorra",
"native_name": "Andorra",
"locales": "ca"
},
{
"country": "AE",
"en_name": "United Arab Emirates",
@hayatbiralem
hayatbiralem / cities-in-turkey--ordered-by-id.html
Last active June 17, 2024 11:29
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 / 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 / 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 / wp-all-export-functions.php
Last active April 17, 2024 17:08
WP All Export get the image urls from the post content
<?php
function reboot_remove_image_dimensions($str){
$re = '/-\d+x\d+\./m';
return preg_replace($re, '.', $str);
}
function reboot_get_content_images($id){
$p = get_post($id);
$doc = new DOMDocument();
@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 / 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