Skip to content

Instantly share code, notes, and snippets.

View ahmedali5530's full-sized avatar

Ahmed Ali ahmedali5530

View GitHub Profile
@ahmedali5530
ahmedali5530 / pakistan_cities.json
Created April 30, 2020 09:10
JSON array of Pakistan cities
[ "Islamabad", "Ahmed Nager", "Ahmadpur East", "Ali Khan", "Alipur", "Arifwala", "Attock", "Bhera", "Bhalwal", "Bahawalnagar", "Bahawalpur", "Bhakkar", "Burewala", "Chillianwala", "Chakwal", "Chichawatni", "Chiniot", "Chishtian", "Daska", "Darya Khan", "Dera Ghazi", "Dhaular", "Dina", "Dinga", "Dipalpur", "Faisalabad", "Fateh Jhang", "Ghakhar Mandi", "Gojra", "Gujranwala", "Gujrat", "Gujar Khan", "Hafizabad", "Haroonabad", "Hasilpur", "Haveli", "Lakha", "Jalalpur", "Jattan", "Jampur", "Jaranwala", "Jhang", "Jhelum", "Kalabagh", "Karor Lal", "Kasur", "Kamalia", "Kamoke", "Khanewal", "Khanpur", "Kharian", "Khushab", "Kot Adu", "Jauharabad", "Lahore", "Lalamusa", "Layyah", "Liaquat Pur", "Lodhran", "Malakwal", "Mamoori", "Mailsi", "Mandi Bahauddin", "mian Channu", "Mianwali", "Multan", "Murree", "Muridke", "Mianwali Bangla", "Muzaffargarh", "Narowal", "Okara", "Renala Khurd", "Pakpattan", "Pattoki", "Pir Mahal", "Qaimpur", "Qila Didar", "Rabwah", "Raiwind", "Rajanpur", "Rahim Yar", "Rawalpindi", "Sadiqabad", "Sa
@ahmedali5530
ahmedali5530 / pakistan_cities.php
Last active October 20, 2023 17:25
PHP array of Pakistan cities
<?php
$array = array ( 0 => 'Islamabad', 1 => 'Ahmed Nager', 2 => 'Ahmadpur East', 3 => 'Ali Khan', 4 => 'Alipur', 5 => 'Arifwala', 6 => 'Attock', 7 => 'Bhera', 8 => 'Bhalwal', 9 => 'Bahawalnagar', 10 => 'Bahawalpur', 11 => 'Bhakkar', 12 => 'Burewala', 13 => 'Chillianwala', 14 => 'Chakwal', 15 => 'Chichawatni', 16 => 'Chiniot', 17 => 'Chishtian', 18 => 'Daska', 19 => 'Darya Khan', 20 => 'Dera Ghazi', 21 => 'Dhaular', 22 => 'Dina', 23 => 'Dinga', 24 => 'Dipalpur', 25 => 'Faisalabad', 26 => 'Fateh Jhang', 27 => 'Ghakhar Mandi', 28 => 'Gojra', 29 => 'Gujranwala', 30 => 'Gujrat', 31 => 'Gujar Khan', 32 => 'Hafizabad', 33 => 'Haroonabad', 34 => 'Hasilpur', 35 => 'Haveli', 36 => 'Lakha', 37 => 'Jalalpur', 38 => 'Jattan', 39 => 'Jampur', 40 => 'Jaranwala', 41 => 'Jhang', 42 => 'Jhelum', 43 => 'Kalabagh', 44 => 'Karor Lal', 45 => 'Kasur', 46 => 'Kamalia', 47 => 'Kamoke', 48 => 'Khanewal', 49 => 'Khanpur', 50 => 'Kharian', 51 => 'Khushab', 52 => 'Kot Adu', 53 => 'Jauharabad', 54 => 'Lahore', 55 => 'Lalamusa', 56 => 'L
<div class="uploaded-files"></div>
<div id="imagesContainer" class="row"></div>
<button type="button" id="bSave" class="btn btn-info">Load Images</button>
<script>
$('#bSave').click(function(e) {
var images = $('iframe').contents().find('.modal-body').find('img');
if(images.length == 0){
alert('No Images found, please scan some images first.');
return false;
@ahmedali5530
ahmedali5530 / ReflectionExtractor.php
Last active June 19, 2019 13:39
Update in symfony Symfony\property-info\Extractor\ReflectionExtractor.php
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@ahmedali5530
ahmedali5530 / currency-dropdown-list.html
Created May 31, 2018 07:16 — forked from AmrMekkawy/currency-dropdown-list.html
Currency HTML "select" element (dropdown list)
<select name="">
<option value="USD" selected="selected">United States Dollars</option>
<option value="EUR">Euro</option>
<option value="GBP">United Kingdom Pounds</option>
<option value="DZD">Algeria Dinars</option>
<option value="ARP">Argentina Pesos</option>
<option value="AUD">Australia Dollars</option>
<option value="ATS">Austria Schillings</option>
<option value="BSD">Bahamas Dollars</option>
<option value="BBD">Barbados Dollars</option>
@ahmedali5530
ahmedali5530 / import database from cmd
Created March 4, 2017 09:24
this code is used to import large mysql files using mysql cmd tool
mysql -u username -p database_name < file.sql
@ahmedali5530
ahmedali5530 / ParameterBag.php
Last active June 19, 2019 13:34
Recursive get() for symfony, ParameterBag modifications
/**
* Returns a parameter by name, or use : to search in arrays($request->get('form:somefield:anotherfield'))
* $_POST[form][somefield][anotherfield]
*
* @param string $key The key
* @param mixed $default The default value if the parameter key does not exist
*
* @return mixed
*/
public function get($key, $default = null)
@ahmedali5530
ahmedali5530 / config.json
Created March 16, 2016 04:21 — forked from anonymous/config.json
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "#673AB7",
"@brand-success": "#4CAF50",
@ahmedali5530
ahmedali5530 / gist:438d4be7b4ada6094b70
Created November 25, 2015 09:41
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
// Ajax File upload with jQuery and XHR2
// Sean Clark http://square-bracket.com
// xhr2 file upload
// data is optional
$.fn.upload = function(remote,data,successFn,progressFn) {
// if we dont have post data, move it along
if(typeof data != "object") {
progressFn = successFn;
successFn = data;
}