Skip to content

Instantly share code, notes, and snippets.

View amrography's full-sized avatar
🚀
...

Amro Khaled amrography

🚀
...
View GitHub Profile
@Amitesh
Amitesh / backup-to-git.sh
Created December 9, 2011 12:53 — forked from aarongustafson/backup-to-git.sh
DB Backup to Git
#!/bin/bash
##
# MySQL DB dump to Git commit
#
# Dumps the specified mysql database to the given location and commits it and
# the previous database to the Git repository.
#
# It is assumed you have already setup the Git respository to only be the
# a checkout of the database backup location
@naholyr
naholyr / compare.php
Created February 22, 2012 16:27
Extract namespace from a PHP file
<?php
// Works in every situations
function by_token ($src) {
$tokens = token_get_all($src);
$count = count($tokens);
$i = 0;
$namespace = '';
$namespace_ok = false;
while ($i < $count) {
@betweenbrain
betweenbrain / gist:2284129
Created April 2, 2012 14:56
Git command to export only changed files between two commits
git archive --output=file.zip HEAD $(git diff --name-only SHA1 SHA2)
@whitingx
whitingx / meta-tags.md
Created October 5, 2012 16:41 — forked from kevinSuttle/meta-tags.md
Complete List of HTML Meta 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'>
@jimothyGator
jimothyGator / README.md
Last active April 25, 2024 18:00
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
cd /usr/local/etc/nginx/sites-enabled
ln -s ../sites-available/default.conf
ln -s ../sites-available/default-ssl.conf

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default.conf and default-ssl.conf to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/
<?php
###############################################################
# cPanel Subdomains Creator 1.1
###############################################################
# Visit http://www.zubrag.com/scripts/ for updates
###############################################################
#
# Can be used in 3 ways:
# 1. just open script in browser and fill the form
@noelboss
noelboss / git-deployment.md
Last active May 2, 2024 15:47
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@ndbroadbent
ndbroadbent / rn-i18n-locale-identifiers.csv
Last active April 18, 2024 11:43 — forked from JaseHadd/ioslocaleidentifiers.csv
React Native i18n Locale Identifiers
Locale Identifier Description
af Afrikaans
af-NA Afrikaans (Namibia)
af-ZA Afrikaans (South Africa)
agq Aghem
agq-CM Aghem (Cameroon)
ak Akan
ak-GH Akan (Ghana)
am Amharic
am-ET Amharic (Ethiopia)
@stirtingale
stirtingale / instagram_id_to_url.php
Last active November 18, 2019 08:13
Simple PHP function to convert an Instagram ID into a URL.
// based on ggwarpig stackoverflow anwser to
// "Where do I find the Instagram media ID of a image"
// @ https://stackoverflow.com/a/37246231
function instagram_id_to_url($instagram_id){
$url_prefix = "https://www.instagram.com/p/";
if(!empty(strpos($instagram_id, '_'))){
@Razoxane
Razoxane / laravel_conditional_index_migration.php
Created August 8, 2017 01:35
Laravel - Create Index If Not Exists / Drop Index If Exists
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class LaravelConditionalIndexMigration extends Migration
{
/**
* Run the migrations.