Skip to content

Instantly share code, notes, and snippets.

@aur1mas
aur1mas / composer.json
Created March 10, 2013 12:24
composer repository alias
"repositories": [
{
"type": "package",
"package": {
"version": "v0.4.1",
"name": "imagine/Imagine",
"source": {
"url": "https://github.com/aur1mas/Imagine.git",
"type": "git",
"reference": "develop"
<?php
/**
* @Route("/statistika/{leagueName}")
*/
public function indexAction($leagueName = "lkl")
{
return $this->getWidgetPageResponse('index.html.twig', $leagueName);
}
@aur1mas
aur1mas / recover.scpt
Created October 23, 2012 19:15
restore multiple files from Trash
tell application "System Events"
tell process "Finder"
repeat 100 times
tell application "Finder" to open trash
tell application "Finder" to activate
key code 126
key down command
key code 51
key up command
delay 0.2 -- adjust delay as needed
@aur1mas
aur1mas / uploader.js
Created July 31, 2012 06:43
html5 file uploader
/**
* enables HTML5 file uploader & old style for browsers which don't support
*
* @require filedrop.jquery.js
* @author aur1mas <aurimas@devnet.lt>
*/
jQuery.fn.uploader = function(options) {
var defaults = {
paramname: 'pic',
maxfiles: 5,
@aur1mas
aur1mas / countries.json
Created June 7, 2012 08:19
Countries and Regions Supported by PayPal
{"AX":"\u00c5land islands","AL":"Albania","AS":"American samoa","AD":"Andorra","AI":"Anguilla","AG":"Antigua and barbuda","AR":"Argentina","AM":"Armenia","AW":"Aruba","AU":"Australia","AT":"Austria","AZ":"Azerbaijan","BS":"Bahamas","BH":"Bahrain","BD":"Bangladesh","BB":"Barbados","BE":"Belgium","BZ":"Belize","BJ":"Benin","BM":"Bermuda","BT":"Bhutan","BA":"Bosnia-herzegovina","BW":"Botswana","BR":"Brazil","BN":"Brunei darussalam","BG":"Bulgaria","BF":"Burkina faso","CA":"Canada","CV":"Cape verde","KY":"Cayman islands","CL":"Chile","CN":"China","CC":"Cocos (keeling) islands","CO":"Colombia","CK":"Cook islands","CR":"Costa rica","CY":"Cyprus","CZ":"Czech republic","DK":"Denmark","DJ":"Djibouti","DM":"Dominica","DO":"Dominican republic","EC":"Ecuador","EG":"Egypt","SV":"El salvador","EE":"Estonia","FK":"Falkland islands (malvinas)","FO":"Faroe islands","FJ":"Fiji","FI":"Finland","FR":"France","GF":"French guiana","PF":"French polynesia","TF":"French southern territories","GA":"Gabon","GM":"Gambia","GE":"Georgia",
@aur1mas
aur1mas / 1.php
Created May 5, 2012 05:03
example how not to use Active Record pattern
<?php
/**
* user model
*
* @package User
* @author aur1mas <aur1mas@devnet.lt>
*/
class Model_User extends Base_User
{
@aur1mas
aur1mas / Core_Controller_Action.php
Created March 31, 2011 08:22
FlashMessenger implementation with title
<?php
class Core_Controller_Action extends Zend_Controller_Action
{
/**
* add flash message
*
* @param string $message message to output
* @param string $title message title
* @return void
* @author aur1mas <aur1mas@devnet.lt>
<?php
try {
$wkhtmltopdf = new Wkhtmltopdf(array('path' => APPLICATION_PATH . '/../public/uploads/'));
$wkhtmltopdf->setTitle("Title");
$wkhtmltopdf->setHtml("Content");
$wkhtmltopdf->output(Wkhtmltopdf::MODE_DOWNLOAD, "file.pdf");
} catch (Exception $e) {
echo $e->getMessage();
}
@aur1mas
aur1mas / Doctrine1.php
Created December 2, 2010 10:30
Doctrine1 ZFDebug plugin
<?php
/**
* @category ZFDebug
* @package ZFDebug_Controller
* @subpackage Plugins
* @author aur1mas <aur1mas@devnet.lt>
* @copyright Copyright (c) 2008-2009 ZF Debug Bar Team (http://code.google.com/p/zfdebug)
* @license http://code.google.com/p/zfdebug/wiki/License New BSD License
*/
class Core_Controller_Plugin_Debug_Plugin_Doctrine1 extends ZFDebug_Controller_Plugin_Debug_Plugin implements ZFDebug_Controller_Plugin_Debug_Plugin_Interface
@aur1mas
aur1mas / ZFDebug.php
Created November 23, 2010 14:18
enable zfdebug through resource registration
<?php
/**
* This class provides a resource that setup the ZFDebug plugin
*
* @see http://code.google.com/p/zfdebug/
*
*/
class Core_Application_Resource_ZFDebug extends Zend_Application_Resource_ResourceAbstract {