Skip to content

Instantly share code, notes, and snippets.

View glennpratt's full-sized avatar

Glenn Pratt glennpratt

View GitHub Profile
define apci_webapp::gitrepo (
$path = $title,
$remotes = {},
$config = {},
$reference = 'master',
$force = false
) {
exec { "${path} : git init":
command => "git init",
cwd => $path,
SELECT COUNT(uid) FROM users
WHERE created BETWEEN UNIX_TIMESTAMP('2012-01-01') AND UNIX_TIMESTAMP('2013-01-01');
diff --git a/www/includes/common.inc b/www/includes/common.inc
index f80496b..de0eb12 100644
--- a/www/includes/common.inc
+++ b/www/includes/common.inc
@@ -5169,8 +5169,13 @@ function drupal_cron_run() {
$function = $info['worker callback'];
$end = time() + (isset($info['time']) ? $info['time'] : 15);
$queue = DrupalQueue::get($queue_name);
- while (time() < $end && ($item = $queue->claimItem())) {
- $function($item->data);
<?php
if ($not_complete && $due_in_future) {
schedule_email();
}
if ($not_complete && $due_in_future &&
!($due_soon && $in_cart_or_checkout)
) {
schedule_email();
php > empty($totally['made']['up'][1]);
php > echo $totally['made']['up'][1];
PHP Notice: Undefined variable: totally in php shell code on line 1
PHP Stack trace:
PHP 1. {main}() php shell code:0
Notice: Undefined variable: totally in php shell code on line 1
Call Stack:
71083.3853 631640 1. {main}() php shell code:0
@glennpratt
glennpratt / User.thrift
Created November 30, 2012 16:29
allplayers.thrift
enum SexType {
MALE = 1,
FEMALE = 2
}
struct User {
1: string firstname,
2: string lastname,
3: i32 user_id = 0,
4: SexType sex,
<?php
class UserTest extends TestCase {
public function loginOrCreate(User $user) {
try {
$this->getClient()->userService()->login($user);
}
catch (\Exception $e) {
$this->getAdminClient()->userService()->create($user);
// Verify the test users email address.
<?php
namespace AllPlayers\Service;
use AllPlayers\Objects\Group;
class GroupService extends ClientService implements GroupServiceInterface {
public function __construct(Client $client) {}
/**
<?php
namespace SeleniumMinkMigrate\Tests;
use SeleniumMinkMigrate\TestCase;
class TestCaseTest extends TestCase
{
public function setUp() {
$this->setBrowser('*firefox');
$this->setBrowserUrl('http://www.google.com');
$ if [ -L "allplayers-mainline_tests" ]; then echo "found it" ; fi
found it
$ if [ -e "allplayers-mainline_tests" ]; then echo "found it" ; fi
found it
$ if [ -e "tests" ]; then echo "found it" ; fi
found it
$ if [ -L "tests" ]; then echo "found it" ; fi
$