Skip to content

Instantly share code, notes, and snippets.

View mohammedtalal's full-sized avatar
🎯
Focusing

Mohammed Talal Zidan mohammedtalal

🎯
Focusing
View GitHub Profile
@mohammedtalal
mohammedtalal / index.md
Created August 12, 2022 13:57 — forked from lcherone/index.md
Template variable replacement, js and php

In PHP

<?php
$vars = [
  'name' => 'Loz'
];

$template = 'Hello {{ name }}!';
@mohammedtalal
mohammedtalal / gist:7888dc0f14b32ef9325c91b96225e556
Created February 9, 2021 16:29 — forked from danielestevez/gist:2044589
GIT Commit to an existing Tag
1) Create a branch with the tag
git branch {tagname}-branch {tagname}
git checkout {tagname}-branch
2) Include the fix manually if it's just a change ....
git add .
git ci -m "Fix included"
or cherry-pick the commit, whatever is easier
git cherry-pick {num_commit}
@mohammedtalal
mohammedtalal / Response.php
Created December 12, 2019 12:13 — forked from jeffochoa/Response.php
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
@mohammedtalal
mohammedtalal / gist:d049977275cb4eb2ba9bb0fede2e1a73
Created December 4, 2019 11:13 — forked from jnaskali/gist:2000102
PHP: Send XML over POST with cURL and save response
function sendXmlOverPost($url, $xml) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
// For xml, change the content-type.
curl_setopt ($ch, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml"));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
@mohammedtalal
mohammedtalal / starter.sh
Last active March 14, 2019 09:34
Script that run when OS start, to make development environment ready
#!/bin/sh
# google chrome
google-chrome www.soundcloud.com/you/likes
echo "Ready to listen music"
# open guake terminal and up laradock containers
# move to a specific directory on laradock workspace
WORKSPACE_URL="~/workspace/"
PROJECT_NAME="first_project"