- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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/'" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$visitor = new CM_Visitor(); | |
$visitor_data = $visitor->get_user_data(); | |
print_r($visitor_data); | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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/ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget http://wordpress.org/latest.tar.gz | |
tar -zxvf latest.tar.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
NewerOlder