Skip to content

Instantly share code, notes, and snippets.

View akrabat's full-sized avatar

Rob Allen akrabat

View GitHub Profile
@akrabat
akrabat / a2.php
Created December 12, 2011 21:57
Simple phptags test file
<?php
class
Test // This is my test [2011]
{
public $foo;
protected $bar;
static public $baz;
public function a($b, $c)
@akrabat
akrabat / UnauthorizedStrategy.php
Created September 25, 2012 19:27
bjyAuthorise view strategy to redirect to login page on auth failure
<?php
namespace Application\View;
use BjyAuthorize\Service\Authorize;
use Zend\EventManager\EventManagerInterface;
use Zend\EventManager\ListenerAggregateInterface;
use Zend\Http\Response as HttpResponse;
use Zend\Mvc\MvcEvent;
use Zend\Stdlib\ResponseInterface as Response;
@akrabat
akrabat / gist:4657932
Created January 28, 2013 18:37
Simple (No doubt, inefficient) word count system in Objective-C
-(NSUInteger) wordCount: (NSString *) string {
__block NSUInteger wordCount = 0;
[string enumerateSubstringsInRange:NSMakeRange(0, string.length)
options:NSStringEnumerationByWords
usingBlock:^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop) {
wordCount++;
}];
return wordCount;
}

Keybase proof

I hereby claim:

  • I am akrabat on github.
  • I am akrabat (https://keybase.io/akrabat) on keybase.
  • I have a public key whose fingerprint is 9289 3FAB 4437 CB7D B16D EDE8 A1F0 71AF 3F62 EEFF

To claim this, I am signing this object:

@akrabat
akrabat / sublime-3-packages.txt
Created November 10, 2014 15:24
Sublime 3 packages that I use
Sublime 3 packages that I use:
Must have (IMO):
Package Control (!)
SideBarEnhancements
Case Conversion
Change Quotes
SublimeLinter
SublimeLinter-php
SublimeLinter-phpcs
@akrabat
akrabat / rgrep.sh
Created November 11, 2014 19:21
Recursive grep with surround info and no vcs matches
#!/bin/sh
grep -C 2 -n -r $@ . | egrep -v ".git|.svn|swp|cache"
@akrabat
akrabat / mail.txt
Last active August 29, 2015 14:18
Email conversation
On 27 Mar 2015, at 23:20, Fred <redacted@gmail.com> wrote:
Hi Rob,
Can you help me update my PHP in my OS X Yosemite ?
On 30 Mar 2015, at 08:01, Rob Allen <rob@akra_bat.com> wrote:
Hi,
<?php
//cli command entrypoint
include 'conf.php';
/**
*
use any cli library
*/
@akrabat
akrabat / slim-container-examples.php
Last active April 28, 2020 08:14
Example uses of Slim 3's container
<?php
// All file paths relative to root
chdir(dirname(__DIR__));
require "vendor/autoload.php";
$settings = ['foo' => 'FOO', 'bar' => 'BAR'];
$app = new \Slim\App($settings);
// Set some things into the container
@akrabat
akrabat / instructions.md
Last active August 29, 2015 14:23
Downgrade joindin-vm to 5.5
  1. Update Vagrantfile. Change:

     ji_config.vm.box = 'joindin/development'
    

    to

     ji_config.vm.box = 'puphpet/debian75-x64'
    
  2. Update puppet/modules/joindin/templates/dotdeb.sources.list. Change: