Skip to content

Instantly share code, notes, and snippets.

View andyshand's full-sized avatar
🧠
Focusing

andy shand andyshand

🧠
Focusing
View GitHub Profile
@andyshand
andyshand / functions.php
Created October 6, 2019 13:13
Add to functions.php
// ... rest of functions.php
function unwrap_iframes( $content ) {
$content = preg_replace('/<p>\s*(<iframe.*>*.<\/iframe>)\s*<\/p>/iU', '\1', $content);
return $content;
}
add_filter( 'the_content', 'unwrap_iframes' )
@andyshand
andyshand / batch_update_sc.js
Last active June 19, 2019 14:56
Batch update tracks on soundcloud
/**
* Fill in the deets below
*/
const USER_ID = `XXXXXXXX` // search for "soundcloud://users" in dev tools, check out the number after to find it
const Authorization = "OAuth 1-XXXXXX-XXXXXXXX-XXXXXXXXXXXXX" // in dev tools>network, look at XHR requests and find one with "Authorization" request header
const CLIENT_ID = `XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX` // search for "client_id" in dev tools network tab
const TRACK_LIMIT = 100
const NEW_DESCRIPTION = `Your description goes here. \n for new lines`
const NEW_TAGS = `Your Tags Separated By Spaces`
@andyshand
andyshand / fix_github_https_repo.sh
Created January 4, 2019 10:05 — forked from m14t/fix_github_https_repo.sh
Convert HTTPS github clones to use SSH
#/bin/bash
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'`
if [ -z "$REPO_URL" ]; then
echo "-- ERROR: Could not identify Repo url."
echo " It is possible this repo is already using SSH instead of HTTPS."
exit
fi