Skip to content

Instantly share code, notes, and snippets.

View aknosis's full-sized avatar
🏔️
Working Remotely

Paul Giberson aknosis

🏔️
Working Remotely
View GitHub Profile
@brandonsavage
brandonsavage / gist:801f921012d553b1a95d
Created January 7, 2015 15:03
My favorite function in PHP...
public function configure(array $values = array())
{
foreach ($values as $key => $value) {
if (property_exists($this, $key)) {
$this->$key = $value;
}
}
return $this;
}
anonymous
anonymous / mfp.sh
Created February 22, 2016 03:23
curl \
-O http://datashat.net/music_for_programming_0-manifesto.mp3 \
-O http://datashat.net/music_for_programming_1-datassette.mp3 \
-O http://datashat.net/music_for_programming_2-sunjammer.mp3 \
-O http://datashat.net/music_for_programming_3-datassette.mp3 \
-O http://datashat.net/music_for_programming_4-com_truise.mp3 \
-O http://datashat.net/music_for_programming_5-abe_mangger.mp3 \
-O http://datashat.net/music_for_programming_6-gods_of_the_new_age.mp3 \
-O http://datashat.net/music_for_programming_7-tahlhoff_garten_and_untitled.mp3 \
-O http://datashat.net/music_for_programming_8-connectedness_locus.mp3 \
@ravibhure
ravibhure / git_rebase.md
Last active April 11, 2025 09:30
Git rebase from remote fork repo

In your local clone of your forked repository, you can add the original GitHub repository as a "remote". ("Remotes" are like nicknames for the URLs of repositories - origin is one, for example.) Then you can fetch all the branches from that upstream repository, and rebase your work to continue working on the upstream version. In terms of commands that might look like:

Add the remote, call it "upstream":

git remote add upstream https://github.com/whoever/whatever.git

Fetch all the branches of that remote into remote-tracking branches, such as upstream/master:

git fetch upstream

@coderabbi
coderabbi / post-merge
Created December 18, 2017 11:27
'composer install' git post-merge hook
# .git/hooks/post-merge
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
composer_install_on_changed_lockfile() {
echo "$changed_files" | grep --quiet "composer.lock" &&
echo "Changes to 'composer.lock' detected; running 'composer install'." &&
composer install
}