Skip to content

Instantly share code, notes, and snippets.

View harikt's full-sized avatar
⛱️
Tanvish Technologies

Hari K T harikt

⛱️
Tanvish Technologies
View GitHub Profile
@harikt
harikt / hiandhello.php
Created April 18, 2015 05:12
Relying on someone else interface is really a bad idea, if they do a BC break and who don't follow semver.org
<?php
namespace x {
interface HiInterface
{
public function sayHi();
}
}
namespace Y {
use X\HiInterface;
@harikt
harikt / Hello.php
Created April 6, 2015 15:10
Trying atoum ...
<?php
// src/Hello.php
namespace Vendor\Package;
class Hello
{
public function sayHi()
{
return "Hey";
}
@harikt
harikt / dbconnected.md
Last active August 29, 2015 14:17
How to use Aura.Sql, Aura.View with Aura.Web_Project
composer create-project aura/web-project quick-start
cd quick-start
composer require "foa/html-view-bundle:2.*"

Edit config/Common.php and in define() method add

<?php
<?php
$tags = array(
new Tag(23, 'php'),
new Tag(56, 'zf2'),
new Tag(45, 'aura'),
new Tag(57, 'symfony'),
new Tag(45, 'cake'),
new Tag(43, 'slim'),
);
@harikt
harikt / scrapy
Created March 17, 2015 03:58
Running scrapy via `python module/scrapy/cmdline.py` http://stackoverflow.com/questions/29078571/iron-worker-and-scrapy
$ python module/scrapy/cmdline.py version
Traceback (most recent call last):
File "module/scrapy/cmdline.py", line 168, in <module>
execute()
File "module/scrapy/cmdline.py", line 136, in execute
settings.setdict(cmd.default_settings, priority='command')
AttributeError: 'CrawlerSettings' object has no attribute 'setdict'
<?php
namespace FixtureLoader;
use Doctrine\Common\Persistence\Mapping\ClassMetadata;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Instantiator\Instantiator;
class SimpleFixtureLoader
{
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
<?php
class FastForwarder
{
protected $skipWhen;
protected $numDays;
public static function createWithDays($num_days)
{
$ff = new static;

Hey,

Nice write up. If the applications can work on 5.3, there will not be much problems to upgrade to the latest versions of PHP.

May be all library owners should consider upgrading the php versions of libraries and force people to update the apps to latest versions. Then there is a question of how to overcome the legacy applications. We should provide an alternative library which works with the latest version.

Eg : we have password_ functions for less than 5.5. Like that we should replace other functions which can make use of the 5.5 functionality .

Thoughts ?

<?php
/**
* ProcessWire 'Hello world' demonstration module
*
* Demonstrates the Module interface and how to add hooks.
*
* See README file for further links regarding module development.
*
* ProcessWire 2.x