Skip to content

Instantly share code, notes, and snippets.

View chrisns's full-sized avatar

Chris Nesbitt-Smith chrisns

View GitHub Profile
<?php
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* AES implementation in PHP */
/* (c) Chris Veness 2005-2011 www.movable-type.co.uk/scripts */
/* Right of free use is granted for all commercial or non-commercial use providing this */
/* copyright notice is retainded. No warranty of any form is offered. */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
class Aes {
diff --git modules/field/field.api.php modules/field/field.api.php
index 5f64117..683d9b6 100644
--- modules/field/field.api.php
+++ modules/field/field.api.php
@@ -259,6 +259,32 @@ function hook_field_schema($field) {
}
/**
+ * Allow modules to alter the schema for a field.
+ *
@chrisns
chrisns / maestro_og_hack.patch
Created October 26, 2012 10:44
neuter maestro's og integration
diff --git maestro.admin.inc maestro.admin.inc
old mode 100644
new mode 100755
index 76cc821..14743d5
--- maestro.admin.inc
+++ maestro.admin.inc
@@ -750,7 +750,7 @@ function maestro_export($id) {
case MaestroAssignmentTypes::GROUP:
if ($assign_by == MaestroAssignmentBy::FIXED) {
@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='"
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 / 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
<?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;
--- 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 '.
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 @@
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