The popular open-source contract for web designers and developers by Stuff & Nonsense
- Originally published: 23/12/2008
- Revised date: 15/12/2013
- Original post
myapp.factory("movies", function($q, $http){ | |
var cacheMovies, p; | |
return { | |
getMovies: function(){ | |
return $q.when(cacheMovies || p || helper()); | |
} | |
} | |
function helper(){ | |
var deffered = $q.defer(); | |
p = deffered.promise; |
//Problem: Hints are shown even when form is valid | |
//Solution: Hide and show them at appropriate times | |
var $password = $("#password"); | |
var $confirmPassword = $("#confirm_password"); | |
//Hide hints | |
$("form span").hide(); | |
function isPasswordValid() { | |
return $password.val().length > 8; |
//Problem: User when clicking on image goes to a dead end | |
//Solution: Create an overlay with the large image - Lightbox | |
var $overlay = $('<div id="overlay"></div>'); | |
var $image = $("<img>"); | |
var $caption = $("<p></p>"); | |
//An image to overlay | |
$overlay.append($image); |
<?php | |
function birthday($birthday){ | |
$age = strtotime($birthday); | |
if($age === false){ | |
return false; | |
} | |
list($y1,$m1,$d1) = explode("-",date("Y-m-d",$age)); |
<input data-datepicker-force="0" data-datepicker-settings="date" data-datepicker-months="Januar,Februar,März,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember" data-datepicker-day |
<?php | |
namespace Sfi\Migration\Command; | |
/* * | |
* This script belongs to the TYPO3 Flow package "Sfi.Migration". * | |
* * | |
* */ | |
use TYPO3\Flow\Annotations as Flow; | |
use TYPO3\Flow\Cli\CommandController; |
(function () { | |
'use strict'; | |
}()); |
http://murrayhopkins.wordpress.com/2008/10/28/mysql-left-join-on-last-or-first-record-in-the-right-table/ |