Skip to content

Instantly share code, notes, and snippets.

View abudayah's full-sized avatar
🎯
Focusing

abudayah

🎯
Focusing
View GitHub Profile
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@abudayah
abudayah / tbl_country.sql
Last active January 29, 2018 13:14
SQL Countries Table with Arabic names Palestine included and "Israel" was removed
CREATE TABLE IF NOT EXISTS `tbl_country` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name_en` varchar(128) COLLATE utf8_unicode_ci NOT NULL,
`name_ar` varchar(128) COLLATE utf8_unicode_ci NOT NULL,
`code` varchar(4) CHARACTER SET latin1 DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=262 ;
INSERT INTO `tbl_country` (`id`, `name_en`, `name_ar`, `code`) VALUES
(1, 'Afghanistan', 'أفغانستان ', 'AF'),
@abudayah
abudayah / detect foursquare api
Last active December 18, 2015 10:59
Get foursquare venue id by URL.
<?php
$url = 'https://foursquare.com/v/snacks-express/50b46d6ae4b06572462ed863';
$purl = parse_url($url);
$path = explode("/", $purl['path']);
$name = str_replace("-"," ", ucwords($path[2]));
$foursquare_name = $name;
$foursquare_venue_id = $path[3];