Skip to content

Instantly share code, notes, and snippets.

@AmrSoliman
AmrSoliman / pr-compare.sh
Created December 5, 2022 10:46 — forked from jesstelford/pr-compare.sh
List the Pull Requests which have been merged into one branch but not another. Execute this from within a git directory that has it's `origin` remote set to github.
#!/bin/sh
if (( $# < 2 )) || (( $# > 3 ))
then
echo "$0 <are-in-this-branch> <are-not-in-this-branch> [<url-of-repo>]"
exit 1
fi
URLPREFIX=
if (( $# == 3 ))
then
URLPREFIX=$(echo "$3/pull/" | sed -e 's/[\/&]/\\&/g')
@AmrSoliman
AmrSoliman / file.md
Last active October 9, 2018 16:16
Make a change in a composer vendor folder and push to branch
Go into the directory of the vendor package that you changed

cd vendor/<owner>/<package>

Create a new git repository (composer does not check out the full git repo by default. Only a sparse copy)

git init

Create a new branch for your local changes

git checkout -b branchname

Commit changes
# Source: http://choyan.me/oh-my-zsh-elementaryos/
sudo apt-get update && sudo apt-get install -y curl vim git zsh
curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | bash
sudo chsh -s $(which zsh) $(whoami)
@AmrSoliman
AmrSoliman / auto suspen homestead.md
Last active August 29, 2015 14:16
Suspend/resume all Vagrant boxes on system shutdown/startup

So, we’ve been using Vagrant a lot lately at work, and one thing that bugged me was whenever i shutdown my computer, it wouldn’t because I forgot to suspend or halt my running Vagrant boxes before shutting down.

So, I wrote a simple init script that suspends all running boxes, nice and easy. It should handle multiple users also (I have not tested this thou).

#!/bin/sh -e
### BEGIN INIT INFO
# Provides:          something warm and fuzzy 
# Required-Start:    vboxdrv
# Required-Stop:     vboxdrv
# Default-Start: 2 3 4 5
@AmrSoliman
AmrSoliman / phpMyAdmin with Homestead.md
Last active August 29, 2015 14:14
Install and Using phpMyAdmin with Homestead box

Using phpMyAdmin with Homestead box

Once the Homestead vagrant box is installed successfully, we can add phpMyAdmin and config it to run with Nginx.

Install phpMyAdmin

  • SSH into Homestead vagrant box with vagrant ssh and type the following command:
    sudo apt-get install phpmyadmin
<?php
/* * **
*
* This script converts an existing MySQL database to migrations in Laravel 4.
*
* 1. Place this file inside app/controllers/
*
* 2. In this file, edit the index() method to customize this script to your needs.
* - inside $migrate->ignore(), you pass in an array of table

#Introduction If you're a php developer on ubuntu, there comes the time where you have to install/reinstall your system. I did it already a few times and i decided to write down the steps for a typical web developer stack with php. This is for a developer machine and not for a live environment!

I hope it helps you too!

fyi @mheiniger and me started with an installer here: https://github.com/mheiniger/webdev-setup

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'>