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
-- This SQL file will remove all users for a specific blog from the network tables (`wp_users` and `wp_usermeta`) | |
-- Set the value of `@newBlogID` to the ID of the blog for which you want to remove all users. | |
-- Useful for reimporting content and users/rerunning a migration. | |
@newBlogID = TKTK; | |
DROP TEMPORARY TABLE IF EXISTS temp_user_ids; | |
CREATE TEMPORARY TABLE IF NOT EXISTS temp_user_ids SELECT user_id as ID FROM wp_usermeta WHERE meta_key = CONCAT('wp_', @newBlogID, '_capabilities'); | |
DELETE FROM wp_users WHERE ID in (SELECT ID from temp_user_ids); | |
DELETE FROM wp_usermeta WHERE user_id in (SELECT ID from temp_user_ids); |
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 phpmailer_debug_settings($phpmailer) { | |
$phpmailer->isSMTP(); | |
$phpmailer->Host = 'localhost'; | |
$phpmailer->Port = 1025; | |
} | |
add_action('phpmailer_init', 'phpmailer_debug_settings'); |
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
#!/bin/bash | |
function print_help() { | |
echo "A command line interface for the services provided by http://ipinfo.io | |
Example usage: | |
ipinfo [ADDRESS] [ip | hostname | loc | org | city | region | country | phone | geo] | |
ipinfo 8.8.8.8 geo | |
{ "ip": "8.8.8.8", "city": null, "region": null, "country": "US", "loc": "38.0000,-97.0000" } |
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
#!/bin/bash | |
# | |
# Install: | |
# | |
# Copy this file to a location included in your PATH. | |
# | |
# Usage: | |
# | |
# $ dnsmasqutil stop|start|restart |
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
/** | |
* Author: Ryan Nagle | |
* https://gist.github.com/rnagle/10181125 | |
* | |
* APDate takes an object with keys describing a date/time. The method `ap` returns | |
* a string using AP style for the specified day, month, year. | |
* | |
* Usage: | |
* | |
* var d = new APDate({ month: 8, day: 8, year: 1989 }); |
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
// Omniture.js is a clean up of Tribune's boilerplate Omniture | |
// code with some added convenience methods for setting vars, | |
// recording page views, etc. | |
// | |
// It sets up a singleton `omniture` object to use for all your | |
// Omniture needs. | |
// | |
// Example use: | |
// | |
// window.omniture.init('saccountgoeshere', { |
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
/** | |
* Original author: David Eads (https://github.com/eads) | |
* | |
* Wrap D3 charting components in a simple Backbone view interface | |
* | |
* Provides a redrawing path, data sync, and fallback for non-d3 browsers. | |
* | |
* Views that extend ChartView should implement their own "draw" function and go to work. | |
* | |
* var collection = new Backbone.Collection([ ["Maria", 33], ["Heather", 29] ]); |
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
var ObligationDebtChartView = ChartView.extend({ | |
constructor: function(options) { | |
ChartView.apply(this, arguments); | |
this.create_tooltip(); | |
this.$chart_container.attr('id', 'debt-chart-container'); | |
return this; | |
}, | |
draw: function() { |
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
var clients = Array(10), | |
url = 'http://localhost:5000/'; | |
var on = function(resource) { | |
if (resource.url.match('data.json')) | |
this.echo("[update] Received: " + resource.url, 'INFO'); | |
}; | |
var start = function() { | |
if (this.resourceExists('data.json')) { |
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
import os | |
from boto import connect_s3 | |
from boto.exception import S3ResponseError | |
from boto.s3.key import Key | |
from config import AWS_SECRET_ACCESS_KEY, AWS_ACCESS_KEY_ID, S3_BUCKET | |
bucket_name = S3_BUCKET | |
conn = connect_s3(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY) |