This file contains 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 is a random gist for sdboyer. |
This file contains 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 | |
require "../querypath/src/QueryPath/QueryPath.php"; | |
$apikey = 'YOUR_KEY_HERE'; | |
$text = 'YOUR TEXT HERE'; | |
/* | |
// Code for working with this. | |
$qp = qp('./amp2.xml'); |
This file contains 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
function checkPlain(str) { | |
var r = new RegExp('(&)|(\")|(<)|(>)|([^&\"<>]*)', 'g'); | |
var replacements = ["&", """, "<", ">"]; | |
var retval = ''; | |
var match = r.exec(str); | |
while (match[0] != "") { | |
for (var i = 1; i < match.length; ++i) { | |
if (match[i] != undefined) { | |
retval += (i == 5 ? match[i] : replacements[i-1]); | |
} |
This file contains 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
.node-unpublished{background-color:#fff4f4;}.preview .node{background-color:#ffffea;}#node-admin-filter ul{list-style-type:none;padding:0;margin:0;width:100%;}#node-admin-buttons{float:left; | |
margin-left:0.5em; | |
clear:right;}td.revision-current{background:#ffc;}.node-form .form-text{display:block;width:95%;}.node-form .container-inline .form-text{display:inline;width:auto;}.node-form .standard{clear:both;}.node-form textarea{display:block;width:95%;}.node-form .attachments fieldset{float:none;display:block;}.terms-inline{display:inline;} | |
fieldset{margin-bottom:1em;padding:.5em;}form{margin:0;padding:0;}hr{height:1px;border:1px solid gray;}img{border:0;}table{border-collapse:collapse;}th{text-align:left; | |
padding-right:1em; | |
border-bottom:3px solid #ccc;} |
This file contains 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 | |
if (count($argv) < 2) { | |
print "Usage: php testmode.php file [file [...]]" . PHP_EOL; | |
exit(1); | |
} | |
array_shift($argv); | |
foreach ($argv as $file) { | |
print "=== Testing $file" . PHP_EOL; |
This file contains 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
# Deploy an example Drupal site. | |
# TODO Move this to a definition with parameters. | |
require_recipe "mysql" | |
require_recipe "drush" | |
require_recipe "drush_make" | |
docroot = "#{node[:www_root]}/drupal/www" | |
cookbook_file "#{node[:www_root]}/drupal/drupal.make" do | |
source node[:drupal][:makefile] |
This file contains 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
Vagrant::Config.run do |config| | |
# All Vagrant configuration is done here. For a detailed explanation | |
# and listing of configuration options, please view the documentation | |
# online. | |
# Every Vagrant virtual environment requires a box to build off of. | |
config.vm.box = "base" | |
# config.vm.boot_mode = :gui | |
config.vm.customize do |vm| |
This file contains 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
name "drupal_dev" | |
description "Useful tools for Drupal developers." | |
run_list( | |
"recipe[drupal::dev]", | |
"recipe[drush]", # TRY THIS! | |
#"recipe[drush::head]", | |
#"recipe[drush::pear]", | |
"recipe[drush_make]", | |
"recipe[phpmyadmin]", # TODO Cookbook needs testing! | |
"recipe[webgrind]", # TODO Does this actually work? |
This file contains 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 | |
//define('QP_NO_AUTOLOADER', TRUE); | |
require 'src/qp.php'; | |
function examples_qptest() { | |
$qp = qp("<?xml version=\"1.0\" encoding=\"UTF-8\"?><root/>"); | |
$i = 0; | |
while ($i < 200) { | |
$issuerType = rand() ? 'type1' : 'type2'; | |
$firstName = md5(rand(0,100000)); |
This file contains 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
package main; | |
import ( | |
"fmt" | |
); | |
func main() { | |
var m = make(map[string]interface{}) | |
mf := new(MonkeyFace) |
OlderNewer