Skip to content

Instantly share code, notes, and snippets.

View simensen's full-sized avatar
🎯
Focusing

Beau Simensen simensen

🎯
Focusing
View GitHub Profile
<?php
echo "Hello World.";
@simensen
simensen / gist-hide-footer.js
Created November 7, 2012 18:29
WIP: Hide Gist meta footer via javascript, show on hover.
@simensen
simensen / gist:4028300
Created November 6, 2012 23:05
Adjusting Django Form Fields From a View
form.fields['some_field'].widget.attrs['rows'] = 8
@simensen
simensen / sculpin_site_dev.yml
Created October 16, 2012 21:52
Override URL for Sculpin dev sites (app/config/sculpin_site_dev.yml)
imports:
- sculpin_site.yml
url: http://localhost.local/srcmvn.com/output_dev
@simensen
simensen / spiral_sort.php
Created October 12, 2012 20:12
Spiral Sort
<?php
function spiral_sort($input)
{
// hack to ensure $output has proper indexes. otherwise
// resulting array has proper idx => value but may
// actually be accessed incorrectly.
$output = $input;
$fromFront = 0;
@simensen
simensen / gist:3880426
Last active October 11, 2015 15:28
Install PHPUnit via Composer

Install PHPUnit at a specific version via composer:

mkdir ~/phpunit-3.7.x-composer
cd ~/phpunit-3.7.x-composer
composer require phpunit/phpunit:3.7.*
composer install

Then use it as:

~/phpunit-3.7.x-composer/vendor/bin/phpunit

@simensen
simensen / gist:3862808
Created October 10, 2012 02:28
dflydev/identity-generator and dflydev/identity-generator-dbal examples
<?php
// https://github.com/dflydev/dflydev-identity-generator
// https://github.com/dflydev/dflydev-identity-generator-dbal
use Dflydev\IdentityGenerator\DataStore\Dbal\DataStore;
use Dflydev\IdentityGenerator\Generator\RandomStringGenerator;
use Dflydev\IdentityGenerator\IdentityGenerator;
$maxLength = 10;
@simensen
simensen / RefreshClasspath.php
Created August 30, 2012 14:27
Get the PSR-0 autoload definitions by a post-update/post-install Composer script.
<?php
namespace Dflydev\ClasspathResourceLocator\Composer\Scripts;
use Composer\Script\Event;
use Composer\Autoload\AutoloadGenerator;
use Composer\Repository\CompositeRepository;
class RefreshClasspath
{
<?php
echo 'Hello World!'
@simensen
simensen / composer.json
Created July 9, 2012 13:55
Trying to install VersionControl_Git to be used with a local Phing install managed by Composer
{
"name": "phing/phing",
"description": "PHing Is Not GNU make; it's a PHP project build system or build tool based on Apache Ant.",
"keywords": ["build", "tool", "task"],
"homepage": "http://www.phing.info/",
"license": "LGPL3",
"authors": [
{
"name": "Michiel Rook",
"email": "mrook@php.net"