Skip to content

Instantly share code, notes, and snippets.

@bouassaba
bouassaba / remove_all_git_folders_recursively.sh
Created January 1, 2015 23:24
remove all git folders recursively
find . -name ".git" | xargs rm -rf
@bouassaba
bouassaba / git_change_remote_url.sh
Created December 27, 2014 20:08
git change remote URL
git remote set-url origin git://new.url.here
@bouassaba
bouassaba / php_send_html_email.php
Created December 18, 2014 12:03
PHP send HTML Email
$to = '[email protected]';
$subject = 'Website Change Request';
$headers = "From: " . strip_tags($_POST['req-email']) . "\r\n";
$headers .= "Reply-To: ". strip_tags($_POST['req-email']) . "\r\n";
$headers .= "CC: [email protected]\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
mail($to, $subject, $message, $headers);
@bouassaba
bouassaba / ubuntu_mysql_allow_remote_sccess.sh
Created December 14, 2014 01:49
Ubuntu mysql allow remote access
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH PRIVILEGES;
@bouassaba
bouassaba / magento_update_cart_and_checkout.php
Created December 13, 2014 23:11
magento update cart and checkout
<?php if ($this->isPossibleOnepageCheckout()):?>
<script type="text/javascript">
// <![CDATA[
function updateAndGoto(url) {
var cartForm = $$('.cart form').first();
var action = cartForm.readAttribute('action');
if (action.indexOf('return_url') < 0) {
var glue = action.indexOf('?') < 0 ? '?' : '&';
action += glue + 'return_url=' + url;
cartForm.writeAttribute('action', action);
@bouassaba
bouassaba / ubuntu_add_user_group.sh
Created December 7, 2014 18:38
Ubuntu add user to group
usermod -a -G ftp jerry
@bouassaba
bouassaba / ubuntu_install_less.sh
Created December 7, 2014 11:38
Ubuntu install lessc
sudo apt-get install node-less
@bouassaba
bouassaba / ubunutu_enable_php_mcrypt.sh
Created December 6, 2014 22:22
Ubuntu enable php5-mcrypt
php5enmod mcrypt
@bouassaba
bouassaba / git_add_remote_repo.sh
Last active August 29, 2015 14:10
Git add remote repo
git remote add origin [email protected]:your_username/foo.git
@bouassaba
bouassaba / git_delete_remote_branch.sh
Last active November 2, 2015 08:58
Git delete remote branch
git branch -d the_local_branch
git push origin --delete develop