Skip to content

Instantly share code, notes, and snippets.

<?php
namespace Ibrows\GameBundle\Util;
class ObjectIterator implements \Iterator
{
protected $objects = array();
/**
* @param object $object
<?php
$node = new \PHPParser_Node_Expr_MethodCall(new \PHPParser_Node_Expr_Variable('app'), 'match', array(
new \PHPParser_Node_Scalar_String('/'),
new \PHPParser_Node_Expr_Closure(array(
'stmts' => array(
new \PHPParser_Node_Stmt_Return(
new \PHPParser_Node_Expr_New(
new \PHPParser_Node_Name('\stdClass')
)
<?php
class SimpleSoapClient
{
/**
* @var string
*/
protected $username;
/**
#!/bin/bash
TARGET=/backups/mysqldatabases
IGNORE="mysql|information_schema|performance_schema|test"
CONF=/etc/mysql/debian.cnf
HOST=localhost
PORT=3306
USER=root
PASSWORD=
@dominikzogg
dominikzogg / accessor.php
Last active August 29, 2015 14:06
accessor sample
<?php
/**
* Class Test
* @method $this setVar1(string $var1)
* @method $this getVar1()
* @method string getVar2()
*/
class Test
{
#!/bin/bash
for f in *.mkv ; do ffmpeg -i "$f" -c:v libvpx -b:v 2M -c:a libvorbis "${f%.mkv}.webm" ; done
@dominikzogg
dominikzogg / CRUDTrait.php
Created January 22, 2015 06:53
CRUDTrait.php Skeleton
<?php
trait BaseTrait
{
abstract public function getDoctine();
}
abstract class BaseClass
{
use BaseTrait;
@dominikzogg
dominikzogg / geolocation.html
Created January 8, 2012 12:37
Geolocation mit Mootools, Google Map
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=true"></script>
<script type="text/javascript" src="tl_files/MooGeo-yui-compressed.js"></script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
window.addEvent('domready', function()
{
// Configuration
mapdiv = 'mapdiv';
latdestination = 47;
londestination = 8;
@dominikzogg
dominikzogg / contao-googleanalytics-window-load.html
Created January 8, 2012 14:04
Load Contao Googleanalytics tracking after window load
<!-- indexer::stop -->
<!-- Google Analytics -->
<script type="text/javascript">
<!--//--><![CDATA[//><!--
window.addEvent('load', function()
{
var gaJsHost = (('https:' == document.location.protocol) ? 'https://ssl.' : 'http://www.');
Asset.javascript(gaJsHost + 'google-analytics.com/ga.js',
{
onload: function()
@dominikzogg
dominikzogg / ftp.class.php
Created January 8, 2012 14:07
ftp.class.php
<?php
/**
* ftp.class.php
*
* Distributed under the GNU Lesser General Public License (LGPL v3)
* (http://www.gnu.org/licenses/lgpl.html)
* This program is distributed in the hope that it will be useful -
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.