This file contains hidden or 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
class BaseController extends Controller { | |
public function __construct() | |
{ | |
// controllers in the array have to be authenticated before they can be viewed | |
if(in_array( Request::segment(1), array('job','journal','user')) ) | |
{ | |
echo 'This page needs to be authenticated'; | |
echo '<p>'; |
This file contains hidden or 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
/** | |
* Return the goal step progress values | |
* @param int $id the goal id | |
* @return object contains goal step completion data | |
*/ | |
public static function progress($id) | |
{ | |
$query = "SELECT | |
COUNT(completed) as total, | |
COUNT(if(completed=1, 1, null)) as completed, |
This file contains hidden or 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
/* | |
|-------------------------------------------------------------------------- | |
| Register | |
|-------------------------------------------------------------------------- | |
*/ | |
Route::get('register', function() | |
{ | |
return View::make('register'); | |
}); |
This file contains hidden or 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 | |
/* | |
Directory Listing Script - Version 3 | |
==================================== | |
Script Author: Ash Young <[email protected]> / www.evoluted.net | |
REQUIREMENTS | |
============ | |
This script requires PHP and GD2 if you wish to use the | |
thumbnail functionality. |
This file contains hidden or 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
<h3>Your Timezone</h3> | |
<div class="field"> | |
<select name="timezone-timezone_name" id="id_timezone-timezone_name"> | |
<option value="US/Pacific">US/Pacific</option> | |
<option value="US/Eastern">US/Eastern</option> | |
<option value="Europe/London">Europe/London</option> | |
<option value="Europe/Paris">Europe/Paris</option> | |
<option value="Europe/Amsterdam">Europe/Amsterdam</option> | |
<option value="Europe/Berlin">Europe/Berlin</option> | |
<option value="Australia/Sydney">Australia/Sydney</option> |
This file contains hidden or 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
http://rhodopsin.blogspot.com/2008/05/php-tag-cloud.html | |
PHP Tag Cloud | |
I was trying to develop a tag cloud for one of my sites, and had some difficulty finding the best way to calculate what the size of each tag should be. Since I couldn't find a good solution online, I wrote my own. | |
A little bit of Googling landed me at Prism-Perfect. Here we find a very basic PHP script that really doesn't cut the mustard. The problem is that she takes a strictly linear approach -- the tag proportion (percentage) is used directly to determine the font size of the tag cloud. The reason why this is a poor choice to create a tag cloud is that tag frequency tends to not to be evenly distributed. Instead a few tags will usually have a very high frequency of use, and then it drops off rapidly. A tag cloud created using a tag frequency directly to determine font size will have a few tags that are very large, many tags that are very small, and almost nothing in between. | |
In the comments section of the Prism-Perfect post, I found |
This file contains hidden or 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
// url = "http://www.testing.com/page.php?text=testing&page=34"; | |
// result = getParameterByName("text", url); | |
// result is "testing" | |
function getParameterByName(name, url){ | |
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); | |
var regexS = "[\\?&]" + name + "=([^&#]*)"; | |
var regex = new RegExp(regexS); | |
var results = regex.exec(url); | |
if(results == null) |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>CodePen · Pen</title> | |
<!-- | |
Copyright (c) 2012 Mahroof Ali, http://codepen.io/anon | |
Permission is hereby granted, free of charge, to any person obtaining |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>CodePen · Pen</title> | |
<!-- | |
Copyright (c) 2012 Mahroof Ali, http://codepen.io/anon | |
Permission is hereby granted, free of charge, to any person obtaining |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>CodePen · Pen</title> | |
<!-- | |
Copyright (c) 2012 Mahroof Ali, http://codepen.io/anon | |
Permission is hereby granted, free of charge, to any person obtaining |