Skip to content

Instantly share code, notes, and snippets.

View karamgaby's full-sized avatar
🏠
Working from home

Gaby Karam karamgaby

🏠
Working from home
View GitHub Profile
@karamgaby
karamgaby / export-stores-locations.php
Last active November 29, 2023 17:04
WordPress PHP script to export WP Store Locator plugin stores into a csv file. With customisation this can work with any post type in WordPress
<?php
/**
* This is a quick and ready for production script.
*
* Include this script at the bottom of your functions.php file, e.g.
*
* ```php
* // Your functions.php file
* // ...
@karamgaby
karamgaby / gist:5540d237faadfee990e832f9fde492ef
Created April 29, 2018 12:36 — forked from davisford/gist:5039064
git clone into non-empty directory

Let's say you start a project locally, and do some editing.

$ mkdir -p ~/git/foo && cd ~/git/foo
$ touch NEWFILE

Now you decide you want to create a new github repo and track it, but the directory is non-empty so git won't let you clone into it. You can fix this, thusly: