Skip to content

Instantly share code, notes, and snippets.

@Hounddog
Hounddog / CopyPropertyTask.php
Created August 3, 2012 12:52
Enable the possibility if copying files when a property changes
<?php
/**
*
* @category Phing
* @package CopyPropertyTask
*/
/**
* Inlude Copytask for extending
*/
@Hounddog
Hounddog / EntityManager
Created August 3, 2012 13:53
Zf1 Doctrine Configuration
<?php
use Doctrine\ORM\EntityManager,
Doctrine\ORM\Configuration,
Doctrine\DBAL\Event\Listeners\MysqlSessionInit,
Doctrine\Common\Cache\ArrayCache,
Doctrine\Common\Annotations\AnnotationRegistry,
Doctrine\Common\Annotations\AnnotationReader,
Doctrine\Common\Annotations\CachedReader,
Doctrine\Common\Annotations\IndexedReader,
Doctrine\ORM\Mapping\Driver\Driver,
<?php
return array(
'modules' => array(
'DoctrineModule',
'DoctrineORMModule',
'DysBase',
'DysAcl',
'Application',
'Smd',
'Site',
@Hounddog
Hounddog / git-publish-branch
Created September 11, 2012 09:36
Collection of Git scripts
#!/usr/bin/env ruby
## git-publish-branch: a simple script to ease the unnecessarily complex
## task of "publishing" a branch, i.e., taking a local branch, creating a
## reference to it on a remote repo, and setting up the local branch to
## track the remote one, all in one go. you can even delete that remote
## reference.
##
## Usage: git publish-branch [-d] <branch> [repository]
##
@Hounddog
Hounddog / AdminNavigationFactory.php
Created September 11, 2012 11:09
NavigationFactory
<?php
namespace DysAdmin\Navigation\Service;
use ZfcAdmin\Navigation\Service\AdminNavigationFactory as ZfcAdminNavigationFactory;
use Zend\ServiceManager\ServiceLocatorInterface;
use DysAdmin\Navigation\Navigation;
class AdminNavigationFactory extends ZfcAdminNavigationFactory
{
<?php
/**
* V5
* LICENSE
*
* Insert License here
*
* @package Service
*/
@Hounddog
Hounddog / shoot
Created September 13, 2012 13:41
shoot screenshot imgurl
#!/bin/bash
function uploadImage {
curl -F "image=@$1" -F "key=b64253965d1905005c02f8c8e591f958" http://api.imgur.com/2/upload.xml | grep -E -o "<original>(.)*</original>" | grep -E -o "http://i.imgur.com/[^<]*"
}
http_proxy=
scrot -s "shot.png"
uploadImage "shot.png" | xclip -selection c
rm "shot.png"
#notify-send "Done"
@Hounddog
Hounddog / CopyPropertyTask.php
Created September 27, 2012 09:16
Phing Task to copy files if the properties change
<?php
/**
* V5
* LICENSE
*
* Insert License here
*
* @category Phing
* @package CopyPropertyTask
* @copyright Copyright (c) 2012 Doyousoft
@Hounddog
Hounddog / git-publish-branch
Created September 29, 2012 11:20
Git Publish branch
#!/usr/bin/env ruby
## git-publish-branch: a simple script to ease the unnecessarily complex
## task of "publishing" a branch, i.e., taking a local branch, creating a
## reference to it on a remote repo, and setting up the local branch to
## track the remote one, all in one go. you can even delete that remote
## reference.
##
## Usage: git publish-branch [-d] <branch> [repository]
##
@Hounddog
Hounddog / phpcs
Created October 15, 2012 10:29
PHP Pre commit check for only changed files
#!/bin/bash
# Go to root of the repository
echo 'Checking PHPCS';
width=$(tput cols);
if [ `git rev-parse --verify HEAD` ]; then
against='HEAD'
else