Skip to content

Instantly share code, notes, and snippets.

View colindecarlo's full-sized avatar

Colin DeCarlo colindecarlo

  • Guelph, Ontario, Canada
View GitHub Profile
@colindecarlo
colindecarlo / gist:5336634
Created April 8, 2013 13:05
Execute a method in the parent of the parent class
<?php
class A
{
public $data;
public function __construct($data)
{
$this->data = $data;
}
<?php
$conn = mysql_connect("localhost", "twa312", "dam6av9a");
mysql_select_db("warehouse312", $conn)
or die ('Database not found ' . mysql_error() );
$sql = "select customerID, lastName from customer";
$rs = mysql_query($sql, $conn)
or die ('Problem with query' . mysql_error());
@colindecarlo
colindecarlo / gist:6842363
Created October 5, 2013 15:34
A list of words taken from the Webster's Unabridged Dictionary hosted by Project Gutenberg 2013-10-05.
This file has been truncated, but you can view the full file.
A CAPPELLA
A CHEVAL
A FORTIORI
A MENSA ET THORO
A POSTERIORI
A PRIORI
AAM
AARD-VARK
AARD-WOLF
AARON'S ROD

Keybase proof

I hereby claim:

  • I am colindecarlo on github.
  • I am colindecarlo (https://keybase.io/colindecarlo) on keybase.
  • I have a public key whose fingerprint is FC33 9802 6A76 E846 6702 942D 6120 6FD1 011C F0C1

To claim this, I am signing this object:

colin@fred:~/development/cm/jivial.dev (master)$ cloc src/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php
1 text file.
1 unique file.
0 files ignored.
http://cloc.sourceforge.net v 1.60 T=0.04 s (25.8 files/s, 76484.8 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
PHP 1 414 1352 1198
var gulp = require('gulp');
var less = require('gulp-less');
var _ = require('underscore');
var paths = {
sources: {
less: 'app/assets/less/**/*.less'
},
dests: {
js: 'public/js',
var move = function (source, dest) {
var log = (function(dest) {
return function(source) {
return 'Moving ' + source + ' to ' + dest;
};
})(dest);
gulp.src(source)
.pipe(newer(dest))
.pipe(print(log))
.pipe(gulp.dest(dest));
@colindecarlo
colindecarlo / gist:27e5f7d5261d285df460
Created September 10, 2014 04:43
Jordan Eldredge (@captbaritone) wrote a really helpful post about "Speeding up Laravel tests with database transactions" (http://jordaneldredge.com/blog/speed-up-laravel-tests-with-database-transactions), you should read it. I took what he had done and expanded on it a little, this is my implementation.
As Jordan did, I changed the phpunit bootstrap file from 'bootstrap/autoload.php' to 'bootstrap/testing.php'. My version differs only in that I reference an environment variable `PHPUNIT_SEED_DB`, if that variable is present then I seed the database.
// bootstrap/testing.php
<?php
$shouldSeed = getenv('PHPUNIT_SEED_DB');
if ($shouldSeed) {
passthru("php artisan --env='testing' migrate:refresh");
passthru("php artisan --env='testing' db:seed --class=TestDatabaseSeeder");
$ php demo.php
array(2) {
["coolection"]=>
array(3) {
["memory_before"]=>
int(33828416)
["memory_after"]=>
int(33879160)
["delta"]=>
int(50744)
[Codeception\Exception\ModuleRequire]
REST module requirements are not met!
This module depends on module of Codeception\Lib\InnerBrowser
Please specify the dependent module inside module configuration section.
Example to use PhpBrowser as backend for REST module.
Framework modules can be used as well for functional testing of API.
--
modules:
enabled: [REST, ApiHelper]
depends: