Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am sarva on github.
  • I am sarva (https://keybase.io/sarva) on keybase.
  • I have a public key whose fingerprint is 9ABC 0A9D C5A5 2130 F1FB 794A A86C 0E5A 6C3E D00C

To claim this, I am signing this object:

Array
(
[properties] => Array
(
[pid] => Array
(
[label] => Program ID
[description] => The unique id for the program.
[type] => integer
[schema field] => pid
diff --git a/sites/all/modules/contrib/commerce_recurring/commerce_recurring.module b/sites/all/modules/contrib/commerce_recurring/commerce_recurring.module
index b5fb4be..e7e465a 100644
--- a/sites/all/modules/contrib/commerce_recurring/commerce_recurring.module
+++ b/sites/all/modules/contrib/commerce_recurring/commerce_recurring.module
@@ -397,7 +397,7 @@ function commerce_recurring_new(array $values = array()) {
*
* @return entity $recurring_entity
*/
-function commerce_recurring_new_from_product($order, $product, $fixed_price, $quantity) {
+function commerce_recurring_new_from_product($order, $product, $user, $fixed_price, $quantity) {
@sarva
sarva / migrate-db-pipe.sh
Created May 30, 2013 03:40
Command--line grab DB from migrate-backup drupal module. Usage: ./migrate-db-pipe.sh HOSTNAME COOKIEFILE | gunzip -c | mysql DBNAME
#!/bin/bash
url="http://$1/admin/config/system/backup_migrate"
form=`wget -q -O - --load-cookies $2 $url`
build=`echo $form | grep -o -e 'name="form_build_id" value="[^"]\+"' | awk -F'"' '{print $4}'`
token=`echo $form | grep -o -e 'name="form_token" value="[^"]\+"' | awk -F'"' '{print $4}'`
wget -q -O - --load-cookies $2 --post-data "source_id=db&destination_id=download&profile_id=default&op=Backup%20now&form_id=backup_migrate_ui_manual_quick_backup_form&form_build_id=$build&form_token=$token" $url
@sarva
sarva / multipart_uploads_test.py
Created January 21, 2012 03:32
Streaming multiple files (multipart/form-data) PUT uploads to Tornado (uses a fork that supports body streaming)
"""
This example requires the body-streaming tornado fork at https://github.com/nephics/tornado.
Refer to http://groups.google.com/group/python-tornado/browse_thread/thread/791c67cb86c2dea2.
Supports uploading an unlimited number/size of files in a single
PUT multipart/form-data request. Each file is processed as the stream
finds the part in the form data.
==USAGE==
@sarva
sarva / multipart_uploads_test.py
Created January 21, 2012 03:13
Streaming multiple files (multipart/form-data) PUT uploads to Tornado (uses a fork that supports custom body handlers)
"""
This example requires the custom body handling tornado fork at https://github.com/joshmarshall/tornado.
Refer to http://groups.google.com/group/python-tornado/browse_thread/thread/6413ac33dd7444b0.
Supports uploading an unlimited number/size of files in a single
PUT multipart/form-data request. Each file is processed as the stream
finds the part in the form data.
==USAGE==
@sarva
sarva / btrfs-backup.sh
Created May 13, 2011 09:37
Incremental BTRFS backups
#!/bin/bash
#
# Sync data using rsync to a backup BTRFS fs subvolume and create
# incremental revolving snapshots
#
# Setting the -c option will setup crontab to continue running the
# backup at the set granularity (default daily)
#
# Install:
@sarva
sarva / buildfile.pp
Created May 10, 2011 08:23
Puppet defines to build a complex file across all nodes. Useful for creating config files containing IP addresses of nodes in distributed systems.
# Export a single line
#
# == Parameters
#
# [*namevar*]
# Line of text to include in the file to build
#
# [*file*]
# The file the supplied line will be included in
#