Skip to content

Instantly share code, notes, and snippets.

Ahmad Arafa ahmadmarafa

Block or report user

Report or block ahmadmarafa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View sharedWith.dart
class SharedWith extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(top: 5),
width: double.infinity,
height: 40.0,
child: Stack(
children: <Widget>[
Positioned(
@ahmadmarafa
ahmadmarafa / FileUpload.js
Created Aug 24, 2019
antd fileupload on form submit
View FileUpload.js
import React, { Component } from 'react'
import { Upload, Form, Icon } from "antd";
const formItemLayout = {
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 18 },
@ahmadmarafa
ahmadmarafa / php
Created May 23, 2019
TBolier\RethinkQL getNearest with filter
View php
<?php
$connection = r\connect("127.0.0.1" , null , "myApp") ;
$point = r\point((float) $request->pickup["lng"] , (float) $request->pickup["lat"]);
$data = r\table("connected")->getNearest($point , ["index" => "last_location"])->filter(
r\row("doc")("service_id")->eq( $request->service )
)->run($connection) ;
View Random.php
<?php
namespace Itx\Utilities ;
class Random
{
public static function guid()
{
return sprintf(
'%s-%04x-%04x-%04d-%s',
self::string(8),
View Api.dart
import 'dart:async' ;
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter/foundation.dart';
import 'package:http/http.dart' as http;
class Api
{
SharedPreferences prefs ;
String locale = "en" ;
Api() { this.init(); }
@ahmadmarafa
ahmadmarafa / Ip.php
Last active Feb 22, 2018
Get client ip and info using public apis ..
View Ip.php
<?php
class Ip
{
public function get()
{
if (isset($_SERVER['HTTP_CLIENT_IP']))
{
$ip=$_SERVER['HTTP_CLIENT_IP'];
}
elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR']))
View gist:8cfe27839623bf2b6b96e089a4b6fbdb
<?php
/**
this is a simple method , which will return soundex of transliterated arabic string
*/
function arSoundex($string)
{
// remove any pounctions and any space etc ..
$string = preg_replace("/\\p{P}|\\p{M}/u", "" , $string);
$chars = array(
"ا"=>"أإاآ" ,
You can’t perform that action at this time.