This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ab2pdox; | |
import java.util.Calendar; | |
import java.util.GregorianCalendar; | |
/** | |
* For generating a string containing a calender. | |
* Also contains useful enums to manage | |
*/ | |
public class jcal { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.imageio.ImageIO; | |
import javax.swing.*; | |
import java.awt.*; | |
import java.awt.geom.Rectangle2D; | |
import java.awt.image.BufferedImage; | |
import java.io.*; | |
import java.util.ArrayList; | |
public class wartermarker { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
require_once BASEPATH .'libraries/Zend/Acl.php'; | |
class Acl extends Zend_Acl { | |
function __construct() { | |
$CI = &get_instance(); | |
$this->acl = new Zend_Acl(); | |
$CI->db->order_by('ParentId', 'ASC'); //Get the roles | |
$query = $CI->db->get('user_roles'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE `user_resources` ( | |
`id` INT NOT NULL AUTO_INCREMENT | |
, `name` VARCHAR(255) | |
, `description` VARCHAR(255) | |
, `parentId` INT DEFAULT NULL | |
, PRIMARY KEY (`id`) | |
); | |
CREATE TABLE `user_roles` ( | |
`id` INT NOT NULL AUTO_INCREMENT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO `user_resources` (`id`, `name`, `description`, `parentId`) VALUES | |
(1, 'test', 'Acl Test Controller', NULLL) | |
INSERT INTO `user_roles` (`id`, `name`, `description`, `parentId`) VALUES | |
(1, 'test', 'Acl Test Role', NULLL) | |
INSERT INTO `user_permissions` (`id` ,`role` ,`resource` ,`read` ,`write` ,`modify` ,`delete` ,`publish`) | |
VALUES (NULL , '1', '1', '1', '1', '0', '0', '0'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
class Test extends Controller { | |
function Test() { | |
parent::Controller() | |
$this->load->library('Acl'); | |
define('ROLE', '1'); | |
define('RESOURCE', '1'); | |
} | |
function index() { | |
if (!$this->acl->can_read(ROLE, RESOURCE)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'Zend.php'; | |
require_once 'Zend/Uri/Exception.php'; | |
require_once 'Zend/Uri/Http.php'; | |
require_once 'Zend/Uri/Mailto.php'; | |
abstract class Zend_Uri | |
{ | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
class Auth { | |
/** | |
* @author K.Gautam | |
* @version 0.1 | |
* @todo ability to add configuration. | |
*/ | |
protected $CI=NULL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# What if you wanted to test a single line of code in php ? | |
# Simple | |
echo "<?php phpinfo();" | /path/to/php | |
# Since I am using XAMPP | |
# The following works | |
echo "<?php phpinfo();" | /opt/lampp/bin/php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>jQSlide</title> | |
</head> | |
<body> | |
<img src="" id="slide_show_pic" alt=""> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | |
<script type="text/javascript"> |
OlderNewer