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
{ | |
"projects": { | |
"sample_project": { | |
"type": "wordpress", | |
"repos": { |
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
from scrapy.contrib.spiders import CrawlSpider, Rule | |
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor | |
from spellchecker.items import SpellcheckItem | |
from BeautifulSoup import BeautifulSoup | |
import re,urllib,enchant | |
from string import strip |
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 | |
// No trailing slash | |
define('BURST_LOG_PATH', ABSPATH . 'wp-content'); | |
// Define which get logged in Burst::$_burst_log_levels | |
define('BURST_INFO', 1); | |
define('BURST_DEBUG', 2); | |
define('BURST_CRITICAL', 3); |
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
/** | |
* Generate rewrite rules from a permalink structure. | |
* | |
* The main WP_Rewrite function for building the rewrite rule list. The | |
* contents of the function is a mix of black magic and regular expressions, | |
* so best just ignore the contents and move to the parameters. | |
* | |
* @since 1.5.0 | |
* @access public | |
* |
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
(defun php-closing-paren() | |
"Adds a closing paren to the end of the current line, but before any semicolons, if present." | |
(interactive) | |
(save-excursion | |
(setq now-until-eol (substring (buffer-string) (point) (line-end-position))) | |
(whitespace-cleanup) | |
(move-end-of-line nil) | |
(while (eq (char-before (point)) 59) | |
(backward-char 1)) | |
(insert ")"))) |
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
// Check dependencies | |
include_once(ABSPATH . 'wp-admin/includes/plugin.php'); | |
if (!is_plugin_active('gravityforms/gravityforms.php')) { | |
add_action('admin_notices', function() { | |
echo '<div class="error"><p>This plugin requires the Gravity Forms plugin to be enabled, and is not currently running.</p></div>'; | |
}); | |
if (class_exists('Burst')) { | |
Burst::log("Gravity Forms dependency unmet.", BURST_CRITICAL); | |
} |
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
(defun iso-8601-now() | |
"Insert current date-time string in full ISO 8601 format. | |
Example: 2010-11-29T23:23:35-08:00" | |
(when (region-active-p) | |
(delete-region (region-beginning) (region-end))) |
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
;; add our own mysql product | |
(eval-after-load "sql" | |
'(add-to-list 'sql-product-alist | |
'(mysql-noprompt | |
:name "MySQL" | |
:font-lock sql-mode-mysql-font-lock-keywords | |
:sqli-login nil | |
:sqli-program sql-mysql-program | |
:sqli-options sql-mysql-options | |
:sqli-comint-func sql-comint-mysql |
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 | |
# skip returns of "No syntax errors..." or "Errors parsing... " | |
linterrors=$((find wp-content/themes wp-content/mu-plugins -type f -name "*.php" -exec php -l {} \; | egrep -v "^(No|Errors)") 2>&1) | |
if [ "$linterrors" != "" ]; then | |
echo "[PRE-COMMIT-ERROR]: Failed PHP Lint Check." | |
echo "---------------------------------------------" | |
echo $linterrors | |
exit 1 |
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
public static function _setupRackspace($name, $domain, array $emails=array()) { | |
$rs = new ApiServer(); | |
// Use existing customer, or create them as new | |
if (!($customer = self::_customerExists($name))) { | |
$customer = (object)json_decode($rs->post('/customers', array('name' => $name), 'application/json')); | |
} | |
// Add domain w/ mailboxes | |
$rs->post(sprintf('/customers/%d/domains/%s', $customer->accountNumber, $domain), |