Skip to content

Instantly share code, notes, and snippets.

@codersatx
codersatx / index.html
Created May 3, 2020 23:43 — forked from gaearon/index.html
Add React in One Minute
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Add React in One Minute</title>
</head>
<body>
<h2>Add React in One Minute</h2>
<p>This page demonstrates using React with no build tooling.</p>
@codersatx
codersatx / Helper Functions
Created October 12, 2011 15:45
Random Procedural Functions
<?php
/**
* Functions
*
* This file contains numerous helper functions.
* @author Alex Garcia
* @version 0.1
*/
@codersatx
codersatx / generate_password.php
Created June 17, 2011 19:38
Used to generate hashed passwords.
<?php
define("BASEPATH","pathnamed");
include('login.class.php')?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
@codersatx
codersatx / config.php
Created June 17, 2011 19:37
Config file for login class.
<?php if ( ! defined('BASEPATH')) exit('No direct access allowed');
$config['username'] = '';
$config['error_message'] = 'Sorry we could not log you in.';
$config['logout_message'] = 'You have been logged out.';
$config['default_page'] = 'index.php';
$config['password'] = '' //should be hashed with sha1;
@codersatx
codersatx / login_helper.php
Created June 17, 2011 19:36
A login helper to use in conjunction with the login class.
<?php
define("BASEPATH","pathname");
//To use this include it in the top of all pages you need to protect:
//<?php include_once('login_helper.php');?>
function authenticate($url = 'login.php')
{
session_start();
@codersatx
codersatx / login.class.php
Created June 17, 2011 19:35
A simple login class to do basic protection on a folder.
<?php if ( ! defined('BASEPATH')) exit('No direct access allowed');
/**
* Handles a simple login scenario.
*
* @author Alex Garcia
* @copyright 2011
*/
class Login{
//An array of values used in the system.
@codersatx
codersatx / date-picker.js
Created June 11, 2011 02:06
Some code to manipulate the jQuery UI calendar.
$(document).ready(function(){
var today = new Date();
today = new Date(today.getFullYear(), today.getMonth(), today.getDate()); // Zero time components
var tomorrow = today.getDay() + 1;
var next_two_days = today.getDay() + 2;
var next_three_days = today.getDay() + 3;
var curr_time = getTime();
var curr_day = today.getDate();
@codersatx
codersatx / Project.php
Created May 20, 2011 13:17
The project controller class for a Kohana based cms.
<?php defined('SYSPATH') OR die('No direct access allowed.');
/**
* Project Controller
*
* Handles the data traffic for our projects.
*
* @package Project_Controller
* @category Controllers
* @author Alex Garcia
* @copyright Copyright (c) 2010, KGBTexas
@codersatx
codersatx / Dropdown.php
Created May 20, 2011 13:15
Dropdown class used in Kohana to create dropdowns programatically.
<?php
/**
* Drop Down
*
* Enables easier creation of drop downs within our code.
*/
class Dropdown{
public $dd_open;
public $dd_options;
@codersatx
codersatx / Table.php
Created May 20, 2011 13:14
Table class used in Kohana to build tables programmatically.
<?php defined('SYSPATH') OR die('No direct access allowed.');
/**
* Table
*
* Handles the creation of tables programmatically
*/
class Table{
public $table_open;
public $table_rows;