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
<!DOCTYPE hmtl> | |
<html> | |
<head><title>My todo list</title></head> | |
<body> | |
<h1>My todo list:</h1> | |
<form> | |
<input type="text" id="item" /> | |
<input type="submit" id="save" value="Save" /> | |
</form> | |
<ul id="list"></ul> |
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 | |
function whatever_init() { | |
pubsub_pub('cron.do.something', $arbitrary, $arguments, $here); | |
} | |
function whatever_pubsub_do_something($arbitrary, $arguments, $here) { | |
// This gets run when cron runs | |
} |
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
<!DOCTYPE html> | |
<head> | |
<title>TEST!</title> | |
</head> | |
<body> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script> | |
</body> |
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
register({ | |
name: "Drupal.org", | |
domains: [ 'drupal.org' ], | |
sessionCookieNames: [ 'SESS797294cd3a93256631fb852630ae867a' ], | |
identifyUser: function () { | |
var resp = this.httpGet(this.siteUrl); | |
this.userName = resp.body.querySelector('#userinfo a').textContent.replace('Logged in as ', ''); | |
} | |
}); |
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
Drupal.attachBehaviors = function(context) { | |
context = context || document; | |
if (Drupal.jsEnabled) { | |
// Execute all of them. | |
jQuery.each(Drupal.behaviors, function(callback) { | |
if (!$(context).is(callback + "-processed")) { | |
this(context); | |
$(context).addClass(callback + "-processed"); | |
} | |
}); |
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
// <a href="" class="make-dialog" dialog-width="100" dialog-height="100" title="Testing a popup">Test</a> | |
$("a.make-dialog").badAssDialog(); | |
$.fn.badAssDialog = function() { | |
this.each(function() { | |
var $this = $(this); | |
$this.click(function() { | |
$('<div></div>').load(this.href).dialog({ |
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 | |
/** | |
* Clones a node by directly saving it. | |
*/ | |
function clone_node_save($nid) { | |
if (is_numeric($nid)) { | |
global $user; | |
$node = node_load($nid); |
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 | |
/** | |
* Erase a CCK text field from a node. | |
*/ | |
function el_commons_wipe_cck_text_field(&$node, $field_name) { | |
if (!isset($node->$field_name)) { | |
return; |
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 | |
function createCookie($name, $value = '', $maxage = 0, $path = '', $domain = '', $secure = false, $HTTPOnly = false) { | |
$ob = ini_get('output_buffering'); | |
// Abort the method if headers have already been sent, except when output buffering has been enabled | |
if (headers_sent() && (bool) $ob === false || strtolower($ob) == 'off') { | |
return false; | |
} |
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
=== modified file 'evented-daemon.php' (properties changed: -x to +x) | |
--- evented-daemon.php 2010-07-13 08:01:54 +0000 | |
+++ evented-daemon.php 2010-07-16 19:41:54 +0000 | |
@@ -18,13 +18,20 @@ | |
} | |
/** | |
+ * Generate an HTTP error | |
+ */ | |
+function daemon_error($evhttp_request, $code, $message) { |