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
<!-- // Here I'm using an anchor tag to call the modal, however this can virtually be done anywhere using the same attribute or jquery // --> | |
<a href="#" onClick="showModal('/assignments/create/<?php echo $course['Course']['id'];?>');return false;">Add an Assignment</a> | |
<!-- // JQuery - inside your jquery handler simply call the function, as display in a click // --> | |
$('div#Photo').click(function(){ | |
showModal('/view/to/render/here','specificClassNameForModalCSSTargeting'); | |
return false; // not needed I just like to return something... |
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
span { | |
white-space: pre; /* CSS 2.0 */ | |
white-space: pre-wrap; /* CSS 2.1 */ | |
white-space: pre-line; /* CSS 3.0 */ | |
white-space: -pre-wrap; /* Opera 4-6 */ | |
white-space: -o-pre-wrap; /* Opera 7 */ | |
white-space: -moz-pre-wrap; /* Mozilla */ | |
word-wrap: break-word; /* IE 5+ */ | |
} |
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
function goFullscreen(id) { | |
// Get the element that we want to take into fullscreen mode | |
var element = document.getElementById(id); | |
// These function will not exist in the browsers that don't support fullscreen mode yet, | |
// so we'll have to check to see if they're available before calling them. | |
if (element.mozRequestFullScreen) { | |
// This is how to go into fullscren mode in Firefox |
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
$user['User']['name'] = 'Jerry Harrison'; | |
echo $user['User']['name']; | |
// prints 'Jerry Harrison' | |
// process with strpos and substr; | |
// We use strpos to find the position of the character we wish to remove characters after, it returns the first one | |
// Next we put that number into substr - substr('string', [number of chars to take off the front], [number of chars to count from the start]) | |
// So with that said using zero as the first param and the position of the character we wish to replace as the second we've successfully removed |
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
<a href="/users/delete/12" onclick="return confirm('Are you sure you want to delete this user?');">Delete</a> |
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
// auto open the album | |
var hash = window.location.hash.toString().replace('#','').split('-'); | |
if(hash != ''){ | |
// console.log(hash); | |
if (hash[2] != undefined) { |
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
$this->Sassafras->storeVariables($sass_theme_options); | |
echo $this->Sassafras->build(array( | |
'reset.sass' => 'reset.css', | |
'app.sass' => 'app.css', | |
$this->params['controller'] . DS . $this->params['controller'] . '.sass' => $this->params['controller'] . '.css', | |
$this->params['controller'] . DS . $this->params['action'] . '.sass' => $this->params['controller'] . '_' . $this->params['action'] . '.css' | |
), 'compressed'); |
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 | |
class AppModel extends Model | |
{ | |
public $actsAs = array('Containable'); | |
function lastQuery(){ | |
return $this->getDataSource()->getLog(false, false); | |
} |
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
SELECT `ExampleShift`.`id`, `ExampleShift`.`date`, `ExampleShift`.`description` | |
FROM `lunadesk*******`.`example_shifts` AS `ExampleShift` | |
WHERE | |
((30600 BETWEEN `ExampleShift`.`start_time` AND `ExampleShift`.`end_time`) | |
OR | |
(63000 BETWEEN `ExampleShift`.`start_time` AND `ExampleShift`.`end_time`)) | |
AND | |
`ExampleShift`.`date` = '2013-06-06' | |
AND | |
`ExampleShift`.`user_id` = 27 LIMIT 1 |
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
// Use the router(s) for any internal (relative) links, unless it has a | |
// `data-bypass` attribute or is `target=_blank` | |
$(document).on('click', 'a:not([data-bypass],[target])', function(evt) { | |
var href = $(this).attr('href'), | |
protocol = this.protocol + '//'; | |
// For <a href="#"> links, we always want to preventDefault to avoid having to do | |
// this within each individual Backbone View event function. | |
// (However don't preventDefault on #something URLs in case we need to jump down a page.) |
OlderNewer