Skip to content

Instantly share code, notes, and snippets.

View chrisns's full-sized avatar

Chris Nesbitt-Smith chrisns

View GitHub Profile
--- modules/block/block.module 2009-03-08 19:34:38.000000000 +0100
+++ modules/block/block.module 2009-03-18 00:06:58.000000000 +0100
@@ -454,6 +454,7 @@
$blocks[$region] = array();
}
+ $time = time();
foreach ($blocks[$region] as $key => $block) {
// Render the block content if it has not been created already.
if (!isset($block->content)) {
@chrisns
chrisns / force_blockcache.patch
Created October 17, 2011 13:42
forces block cache to be enabled with a node_access module present and keys the cache entries by the $_SERVER['HTTP_HOST']
diff U modules/block/block.module block/block.module
--- modules/block/block.module Mon Jan 19 22:26:36 1970
+++ modules/block/block.module Mon Jan 19 22:26:36 1970
@@ -515,4 +515 @@
- // Try fetching the block from cache. Block caching is not compatible with
- // node_access modules. We also preserve the submission of forms in blocks,
- // by fetching from cache only if the request method is 'GET'.
- if (!count(module_implements('node_grants')) && $_SERVER['REQUEST_METHOD'] == 'GET' && ($cid = _block_get_cache_id($block)) && ($cache = cache_get($cid, 'cache_block'))) {
+ if ($_SERVER['REQUEST_METHOD'] == 'GET' && ($cid = _block_get_cache_id($block)) && ($cache = cache_get($cid, 'cache_block'))) {
@@ -576,0 +574 @@
/*
RAC arrays
*/
#define ASIZE 32 /* Maximum array size */
byte index;
byte i = 0;
byte j = 0;
byte isIndex = 1;
import java.awt.Robot; //java library that lets us take screenshots
import java.awt.AWTException;
import java.awt.event.InputEvent;
import java.awt.image.BufferedImage;
import java.awt.Rectangle;
import java.awt.Dimension;
import processing.serial.*; //library for serial communication
Serial port; //creates object "port" of serial class
diff U subuser.module subuser.module
--- subuser.module Mon Jan 19 22:26:36 1970
+++ subuser.module Mon Jan 19 22:26:36 1970
@@ -366 +366 @@
- $links[] = l(t(SUBUSER_ADMINISTER), 'admin/user/user');
+ // $links[] = l(t(SUBUSER_ADMINISTER), 'admin/user/user');
diff U subuser.pages.inc subuser.pages.inc
--- subuser.pages.inc Mon Jan 19 22:26:36 1970
+++ subuser.pages.inc Mon Jan 19 22:26:36 1970
@@ -186,0 +187,5 @@
--- workflow.admin.inc 2010-03-02 11:32:54.000000000 -0700
+++ workflow.admin.inc 2010-07-23 10:04:17.000000000 -0600
@@ -122,7 +122,7 @@ function workflow_permissions($wid) {
$all[$role]['name'] = $value;
}
$result = db_query(
- 'SELECT t.roles, s1.state AS state_name, s2.state AS target_state_name ' .
+ 'SELECT t.roles, s1.state AS state_name, s1.sid as state_sid, s1.ref AS state_ref, s2.state AS target_state_name, s2.sid AS target_state_sid, s2.ref AS target_state_ref ' .
'FROM {workflow_transitions} t ' .
'INNER JOIN {workflow_states} s1 ON s1.sid = t.sid '.
<?php
$db_url = array(
'default' => 'mysqli://csp:fff@localhost/drupal6_csp',
// 'default' => 'mysqli://csp:fff@localhost/drupal6_csp2',
// 'default' => 'mysqli://csp:fff@localhost/drupal6_csp_test',
'spool' => 'mysqli://csp:fff@localhost/csp_mailspool',
);
$db_prefix['sessions'] = "drupal6_csp.";
unset($cookie_domain);
global $base_url;
@chrisns
chrisns / gist:2923257
Created June 13, 2012 10:19
socialsecurity popularnames technical test
<?php
// queries http://www.socialsecurity.gov/cgi-bin/popularnames.cgi
// allows user to enter years to aggregate stats over, allows user to limit thei caches if possible
// Given the extra time
// * Functions would have doxygen documentation around them
// * All functions would assert clearly and bail early if they weren't given expected variables
// * Rationalise mixed use of camelCase and snake_case
diff --git includes/handlers/pay_method_direct_paypal.inc includes/handlers/pay_method_direct_paypal.inc
index 9508897..5f9d0d6 100644
--- includes/handlers/pay_method_direct_paypal.inc
+++ includes/handlers/pay_method_direct_paypal.inc
@@ -7,6 +7,7 @@
class pay_method_direct_paypal extends pay_method_direct {
var $paypal_account = '';
var $paypal_sandbox = '';
+ var $paypal_return_url = '';
@chrisns
chrisns / 337089-26b.patch
Created July 17, 2012 09:35
select all in patch difference
diff --git i18n.module i18n.module
index e857633..3bbecc4 100644
--- i18n.module
+++ i18n.module
@@ -459,7 +459,7 @@ function i18n_db_rewrite_sql($query, $primary_table, $primary_key, $args = array
if ($mode == 'mixed') {
$result['where'] = i18n_db_rewrite_where($primary_table, 'node', 'simple');
if (i18n_get_lang() != i18n_default_language()) {
- $result['join'] = "LEFT JOIN (SELECT tnid FROM {node} WHERE tnid <> 0 AND language='"
+ $result['join'] = "LEFT JOIN (SELECT * FROM {node} WHERE tnid <> 0 AND language='"