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 / switch.html
Created November 27, 2012 18:12
Style sheet switcher : This can switch from one default style sheet to another easily.
<html>
<head>
<title>Hello World</title>
<link rel="stylesheet" href="styles/default.css">
<link rel="alternate stylesheet" href="styles/arta.css" title="arta">
<link rel="alternate stylesheet" href="styles/ascetic.css" title="ascetic">
<link rel="alternate stylesheet" href="styles/brown_paper.css" title="brown_paper">
<link rel="alternate stylesheet" href="styles/dark.css" title="dark">
<link rel="alternate stylesheet" href="styles/far.css" title="far">
<link rel="alternate stylesheet" href="styles/github.css" title="github">
@harikt
harikt / unitofwork.php
Created November 29, 2012 16:09
Unit of Work with Aura.Sql
<?php
/**
* Look into https://github.com/harikt/Hari.Sample for the other code.
*
*/
$package_dir = dirname(dirname(__DIR__)) . '/aurasystem/package/';
$loader = require $package_dir . 'Aura.Autoload/scripts/instance.php';
$loader->add('Hari\Sample\\', $package_dir . 'Hari.Sample/src');
$loader->add('Aura\Sql\\', $package_dir . 'Aura.Sql/src');
$loader->register();
// Require the file
$class = "ClassName";
$r = new ReflectionClass($class);
$str = '';
foreach($r->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {
$rm = new ReflectionMethod($class, $method->name);
$pieces = array();
foreach($rm->getParameters() as $params ) {
@harikt
harikt / autoload.php
Created January 29, 2013 18:29
Class usage with Aura.Autoload , please refer https://wiki.php.net/rfc/splclassloader
<?php
$loader = require dirname(dirname(__DIR__)) . '/aurasystem/package/Aura.Autoload/scripts/instance.php';
$loader->setClass('PHPCrawler', __DIR__ . '/libs/PHPCrawler.class.php');
$loader->register();
$loader->setMode(0);
$class = new PHPCrawler();
@harikt
harikt / acl.php
Last active December 12, 2015 02:08
Learning about creating a generic access control
<?php
/*
Hi Guys,
I need some help from the gurus who have already faced and solved the problem.
The aim is to learn about the access control (ACL) and creating a generic ACL
for creating and manipulating the roles and resources for end users.
@harikt
harikt / form.php
Last active December 12, 2015 05:49
Try out Aura Form
<?php
$path = dirname(__DIR__) . '/aurasystem/package';
$system = dirname(__DIR__) . '/aurasystem';
$loader = require $path . '/Aura.Autoload/scripts/instance.php';
$di = require $path . '/Aura.Di/scripts/instance.php';
$configs = array('Aura.Filter', 'Aura.Input', 'Aura.View', 'Aura.Intl', 'Aura.Cli');
foreach ($configs as $config) {
require $path . '/' . $config . '/config/default.php';
@harikt
harikt / packageautoloader.php
Created March 27, 2013 00:56
Package Autoloader
<?php
namespace Vendor\Package;
class FirstException extends \Exception
{
// some code that does the functionality
}
class SecondException extends \Exception
{
@harikt
harikt / wedding.php
Created April 22, 2013 15:16
Copied from a nerd wedding invitation
<?php
class Wedding
{
protected $start;
protected $end;
public function __construct($start = '2013-04-22 09:45', $end = '2013-04-22 10:15')
{
$this->start = $start;
@harikt
harikt / composer.json
Created May 28, 2013 07:24
Including CpanelInc/publicapi-php in composer.
{
"repositories": [
{
"type": "package",
"package": {
"name": "CpanelInc/publicapi-php",
"version": "1.0.0",
"dist": {
"url": "https://github.com/CpanelInc/publicapi-php/archive/master.zip",
"type": "zip"
{
"minimum-stability": "dev",
"require": {
"aura/installer-system" : "1.0.0",
"aura/framework" : "dev-develop",
"aura/demo" : "dev-develop"
}
}
Let us assume this is the composer.json of the user.