Skip to content

Instantly share code, notes, and snippets.

Working from home

Michael Buluma buluma

Working from home
View GitHub Profile
View gist:7512f99fd52dc62292f09532186f3ee3

1. Clone your fork:

git clone

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://
git fetch upstream
buluma / recipe: cherry-pick tags
Created Dec 30, 2017 — forked from nickfloyd/recipe: cherry-pick tags
To cherry pick from head and commit back into a tag
View recipe: cherry-pick tags
-from master in working branch
>> git branch [new branch] [tag]
>> git checkout [branch]
-pull commit out and add it to the commit at the top of the tag
>> git cherry-pick [commit] or git cherry-pick [firstcommit]^..[lastcommit] if you have a range
-resolve conflicts
-delete the local tag
>> git git tag -d [tag]
-add a new tag at the head of the old one
>> git tag [tag]
buluma /
Created Dec 29, 2017 — forked from gunjanpatel/
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}'

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

buluma / gist:a46e02ad92c7c7e50ca9f50f125fe57b
Created Nov 3, 2017 — forked from raramuridesign/gist:8858597
Logout link for Joomla 1.5, 2.5 and 3.0
View gist:a46e02ad92c7c7e50ca9f50f125fe57b
Joomla 1.5 Logout Link
$returnURL = base64_encode(JURI::root() . "");
$user =& JFactory::getUser();
echo 'Hi,'.$user->username;
<a href="index.php?option=com_user&task=logout&return=<?php echo $returnURL; ?>">
<input type="button" name="Submit" class="button" value="Logout"></a>
buluma / my.cnf
Last active Feb 1, 2017 — forked from luk-/my.cnf
CentOS 5.6 default my.cnf
View my.cnf
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
#replication config
buluma / gist:a10a6fb6315b06dca2b3
Last active Jan 7, 2016 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
View gist:a10a6fb6315b06dca2b3
<!doctype html>
<title>Site Maintenance</title>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #007B00; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
buluma / pedantically_commented_playbook.yml
Created Sep 30, 2015 — forked from marktheunissen/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
View pedantically_commented_playbook.yml
# ^^^ YAML documents must begin with the document separator "---"
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
buluma /
Last active Sep 2, 2015 — forked from bgallagh3r/
Wordpress: Bash Install Script -- Downloads latest WP version, updates wp-config with user supplied DB name, username and password, creates and CHMOD's uploads dir, copies all the files into the root dir you run the script from, then deletes itself!
#!/bin/bash -e
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Database Name: "
read -e dbname
echo "Database User: "
read -e dbuser
echo "Database Password: "
You can’t perform that action at this time.