Skip to content

Instantly share code, notes, and snippets.

View greenweb's full-sized avatar

Rew Rixom greenweb

View GitHub Profile
@greenweb
greenweb / youtube-bulk-unsub-fn.js
Created September 15, 2021 21:16
Youtube bulk unsubsribe fn
/**
* Youtube bulk unsubsribe fn.
* Wrapping this in an IIFE for browser compatibility.
*/
(async function iife() {
// This is the time delay after which the "unsubscribe" button is "clicked"; Tweak to your liking!
var UNSUBSCRIBE_DELAY_TIME = 2000
/**
* Delay runner. Wraps `setTimeout` so it can be `await`ed on.
@greenweb
greenweb / wpcli-stuff.txt
Last active November 19, 2019 23:02
wpcli stuff
# wpcli stuff
alias wpbackdb="wp db export --color ~/backups/\"$(date '+%F').wpdb.sql\" --path='/var/www/html/'"
alias wdbup="wpbackdb"
alias wpbackupfiles="tar -v -czf ~/backups/wp-website-$(date '+%F').tar.gz /var/www/html/"
alias backup='wdbup && wpbackupfiles'
alias backupsmall="tar -czf ~/backups/wp-website-$(date '+%F').tar.gz /var/www/html/ --exclude=wp-content"
alias backupdb="wdbup"
# update plugins via sudo as user www-data
alias wpu="sudo -u www-data wp plugin update --all --path='/var/www/html/'"
@greenweb
greenweb / custom_user_contact_methods.php
Created August 25, 2016 21:20
Add extra user info to the user settings page in a wp.org site.
<?php
function my_new_contactmethods( $contactmethods ) {
//add Birthday
$contactmethods['birthday'] = 'Birthday';
//add Address
$contactmethods['address'] = 'Address';
//add City
$contactmethods['city'] = 'City';
//add State
$contactmethods['state'] = 'State';
@greenweb
greenweb / cart66Cloud_userData.php
Created August 3, 2015 21:20
Getting user data out of Cart66 Cloud
<?php
$visitor = new CM_Visitor();
$visitor_data = $visitor->get_user_data();
print_r($visitor_data);
?>
<?php # -*- coding: utf-8 -*-
/**
* Plugin Name: Plugin Class Demo
* Description: How I am using the base class in plugins.
* Plugin URI:
* Version: 2012.09.29
* Author: Thomas Scholz
* Author URI: http://toscho.de
* License: GPL
* Text Domain: plugin_unique_name
@greenweb
greenweb / WP-CLI Install
Created March 6, 2015 09:55
WP-CLI Install
# WP-CLI Install
if [ ! -e /var/www/wp-cli/bin/wp ]; then
printf "\nInstalling wp-cli\n"
git clone git://github.com/wp-cli/wp-cli.git /var/www/wp-cli
cd /var/www/wp-cli
composer install
else
printf "\nSkip wp-cli installation, already available\n"
fi
# Link wp to the /usr/local/bin directory
@greenweb
greenweb / wp-bash
Last active August 29, 2015 14:15
Bash Script to Download latest WordPress and unzip
# Download latest WordPress and uncompress
cd ~
#mkdir -p /path/to/your/potentially/existing/folder
wget http://wordpress.org/latest.tar.gz
tar zxf latest.tar.gz
mv wordpress/* ./
# Grab our Salt Keys
wget -O /tmp/wp.keys https://api.wordpress.org/secret-key/1.1/salt/
@greenweb
greenweb / javascript_resources.md
Last active August 29, 2015 14:15 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@greenweb
greenweb / wp-bash
Last active August 29, 2015 14:15
Download the current version of WordPress to your shell account's home directory and unzip it From http://codex.wordpress.org/UNIX_Shell_Skills
wget http://wordpress.org/latest.tar.gz
tar -zxvf latest.tar.gz
@greenweb
greenweb / 0_reuse_code.js
Last active August 29, 2015 14:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console