Skip to content

Instantly share code, notes, and snippets.

View chrisgrabinski's full-sized avatar
🌭

Chris Grabiński chrisgrabinski

🌭
View GitHub Profile
@chrisgrabinski
chrisgrabinski / wordpress-sync.sh
Last active May 9, 2018 13:42
Sync database and media library between two WordPress installations with WP CLI
# WordPress Sync
# ---------------------------------------------------------------------------------
#!/bin/bash
src=SOURCEDIRECTORY
dest=DESTDIRECTORY
srcUrl=https://staging.source.com
destUrl=https://source.com
cd $src
@chrisgrabinski
chrisgrabinski / wordpress-s3-backup.sh
Last active June 7, 2022 08:12
WordPress S3 Backup Bash Script
# WordPress S3 Backup Script
# ---------------------------------------------------------------------------------
#!/bin/bash
bucket="s3://" # Your S3 Bucket
if [ -z "$1" ]
then
path=$PWD
else
@chrisgrabinski
chrisgrabinski / functions.php
Created January 26, 2015 10:45
(Wordpress) Embed posts in an HTML-template using a shortcode
// [embedpost id="#"]
function embedpost_func( $atts ) {
$a = shortcode_atts( array(
'id' => 'Please add an "id" attribute',
), $atts );
// The post that is queried
$query = get_post($a['id']);
@chrisgrabinski
chrisgrabinski / shopify-auto-currencies-switcher.js
Last active January 16, 2023 20:04
(Shopify) Automatically change a shop's currency based on the customer's geolocation
// Dependencies
// - https://github.com/carolineschnapp/currencies
// Don't change currency if Cookie has been already set
if (Currency.cookie.read() == null) {
jQuery.ajax( {
url: '//freegeoip.net/json/',
type: 'GET',
dataType: 'jsonp',
@chrisgrabinski
chrisgrabinski / keybase.md
Created December 8, 2014 12:21
keybase proof

Keybase proof

I hereby claim:

  • I am chrisgrabinski on github.
  • I am chrisgrabinski (https://keybase.io/chrisgrabinski) on keybase.
  • I have a public key whose fingerprint is DA32 B87D A8D1 62B9 6B21 8510 D6D7 AC51 9BF0 8E5D

To claim this, I am signing this object: