Skip to content

Instantly share code, notes, and snippets.

View khal3d's full-sized avatar
🏠
Working from home

Khaled Attia khal3d

🏠
Working from home
View GitHub Profile
@khal3d
khal3d / fixPhoneNumbers.php
Created May 29, 2017 10:31
Fix and convert phone numbers
<?php
$number = '+2pop0۱00193086۵';
function fixPhoneNumbers($number)
{
// Remove all non numerals characters
$number = preg_replace("/[^0-9\x{0660}-\x{0669}\x{06F0}-\x{06F9}\+]/u", '', $number);
// Convert indic to Arabic numerals
@khal3d
khal3d / runtastic.js
Created November 20, 2013 09:28
Download all your Runtastic activities - Go to "My Activities" and than run this code in you browser console
var links = [];
$('.download a:contains(TCX)').each ( function () {
links.push($(this).attr('href'))
} );
links.forEach(function(link) {
// console.log(link);
var newFrame = document.createElement('iframe');
document.body.appendChild(newFrame);
@khal3d
khal3d / is_rtl.php
Last active September 15, 2022 03:26
Check if there RTL characters (Arabic, Persian, Hebrew)
<?php
/**
* Is RTL
* Check if there RTL characters (Arabic, Persian, Hebrew)
*
* @author Khaled Attia <sourcecode@khal3d.com>
* @param String $string
* @return bool
*/
[Desktop Entry]
Encoding=UTF-8
Version=2.0.1
Name=Sublime Text 2
Exec=subl %u
Terminal=false
Icon=/home/khal3d/applications/Sublime Text 2/Icon/128x128/sublime_text.png
Type=Application
Categories=Application;Utility;IDE;Development;TextEditor
StartupNotify=true