Skip to content

Instantly share code, notes, and snippets.

View mahmoudmagdi's full-sized avatar
💭
I convert caffeine into code

Mahmoud Magdi mahmoudmagdi

💭
I convert caffeine into code
View GitHub Profile
@mahmoudmagdi
mahmoudmagdi / meta-tags.md
Created November 2, 2017 08:17 — forked from kevinSuttle/meta-tags.md
List of Usable HTML Meta and Link Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>

Note

Apple will reject apps that are using private url schemes (Ugh, Apple....) if they are pretty much obvius. Some apps are rejected and others are not, so, be aware of this issue before implementing any of those URL's in your app as a feature.

Updates

  • [UPDATE 4] iOS 10 update: apparently settings now can be reached using App-Pref instead of prefs
  • [UPDATE 3] For now you just can use url schemes to open your apps's settings with Swift 3.0 (Xcode 8). I'll keep you informed when OS preferences can be reached
  • [UPDATE 2] The openURL() method of UIApplication is now deprecated. You should use application(_:open:options:) instead
  • [UPDATE 1] Not yet tested in iOS 10. It will fail because of policies changes in URL scheme handling.
@mahmoudmagdi
mahmoudmagdi / laravellocal.md
Created February 11, 2019 23:00 — forked from hootlex/laravellocal.md
Run laravel project locally

##Windows users:

cmder will be refered as console

##Mac Os, Ubuntu and windows users continue here:

  • Create a database locally named homestead utf8_general_ci
@mahmoudmagdi
mahmoudmagdi / DistanceCalculator.java
Created April 23, 2019 11:15 — forked from danielgomezrico/DistanceCalculator.java
Java / Android - calculate the distance between two coordinates with great circle formula.
import static java.lang.Math.acos;
import static java.lang.Math.cos;
import static java.lang.Math.sin;
/**
* Calculate distance between coordinates.
*/
public class DistanceCalculator {
static double PI_RAD = Math.PI / 180.0;
@mahmoudmagdi
mahmoudmagdi / GoogleMaps.java
Created June 23, 2019 13:24 — forked from mitchtabian/GoogleMaps.java
Launch Google maps app and get directions
String latitude = String.valueOf(49.08);
String longitude = String.valueOf(122.45);
Uri gmmIntentUri = Uri.parse("google.navigation:q=" + latitude + "," + longitude);
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
mapIntent.setPackage("com.google.android.apps.maps");
try{
if (mapIntent.resolveActivity(getActivity().getPackageManager()) != null) {
startActivity(mapIntent);
}
@mahmoudmagdi
mahmoudmagdi / s3-upload-via-form.php
Created August 8, 2019 08:37 — forked from keithweaver/s3-upload-via-form.php
Upload image using form submission to AWS S3 with PHP
<?php
// This file demonstrates file upload to an S3 bucket. This is for using file upload via a
// file compared to just having the link. If you are doing it via link, refer to this:
// https://gist.github.com/keithweaver/08c1ab13b0cc47d0b8528f4bc318b49a
//
// You must setup your bucket to have the proper permissions. To learn how to do this
// refer to:
// https://github.com/keithweaver/python-aws-s3
// https://www.youtube.com/watch?v=v33Kl-Kx30o
@mahmoudmagdi
mahmoudmagdi / s3-upload-via-link.php
Created August 8, 2019 08:38 — forked from keithweaver/s3-upload-via-link.php
Upload image using link to AWS S3 with PHP