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
<div class="counter"> | |
<strong class="h">0</strong> | |
<span>:</span> | |
<strong class="m">0</strong> | |
<span>:</span> | |
<strong class="s">0</strong> | |
</div> | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
var time = (60 * 60 + 60 * 59 + 55); // start from 1 hour and 59 minutes and 55 seconds |
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
<NotepadPlus> | |
<UserLang name="LESS++" ext="less" udlVersion="2.1"> | |
<Settings> | |
<Global caseIgnored="no" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" /> | |
<Prefix Keywords1="no" Keywords2="no" Keywords3="yes" Keywords4="no" Keywords5="yes" Keywords6="no" Keywords7="yes" Keywords8="yes" /> | |
</Settings> | |
<KeywordLists> | |
<Keywords name="Comments">00// 01 02 03/* 04*/</Keywords> | |
<Keywords name="Numbers, prefix1"/> | |
<Keywords name="Numbers, prefix2">#</Keywords> |
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 | |
echo implode(', ',array_intersect_key(array(0=>'guest',1=>'user',2=>'admin'),array_flip(explode(',',$user->role)))); | |
?> |
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
<ul class="js-people"> | |
<li data-name="John Doe">Mr. John Doe</li> | |
<li data-name="Trent Richardson">Mr. Trent Richardson</li> | |
<li data-name="Cindy Smith">Ms. Cindy Smith</li> | |
<li data-name="Bill Williams">Mr. Bill Williams</li> | |
<li data-name="Jane Doe">Mrs. Jane Doe</li> | |
</ul> | |
<script> | |
$(document).ready(function(){ | |
var $people = $('ul.js-people'), |
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
<video id="video" width="640" height="480" autoplay></video> | |
<button id="snap" class="sexyButton">Snap Photo</button> | |
<canvas id="canvas" width="640" height="480"></canvas> | |
<script> | |
/* Put event listeners into place */ | |
window.addEventListener("DOMContentLoaded", function() { | |
// Grab elements, create settings, etc. | |
var canvas = document.getElementById("canvas"), |
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
$(document).mouseup(function (e) | |
{ | |
var container = $("YOUR CONTAINER SELECTOR"); | |
if (!container.is(e.target) // if the target of the click isn't the container... | |
&& container.has(e.target).length === 0) // ... nor a descendant of the container | |
{ | |
container.hide(); | |
} | |
}); |
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 Calendar { | |
static $now = 0; | |
function __construct() { | |
Calendar::$now = time(); | |
} | |
function years($start, $end) { |
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 Password | |
{ | |
const ALPHANUMERIC = 0; | |
const NUMBERS_ONLY = 1; | |
const ALPHABETIC_ONLY = 2; | |
private $password; | |
private $salt; | |
private $hash; |
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
$.fn.extend({ | |
insertAtCaret: function(myValue) { | |
var obj; | |
if( typeof this[0].name !='undefined' ) obj = this[0]; | |
else obj = this; | |
if ($.browser.msie) { | |
obj.focus(); | |
sel = document.selection.createRange(); | |
sel.text = myValue; | |
obj.focus(); |
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 ($, undefined) { | |
$.fn.getCursorPosition = function() { | |
var el = $(this).get(0); | |
var pos = 0; | |
if('selectionStart' in el) { | |
pos = el.selectionStart; | |
} else if('selection' in document) { | |
el.focus(); | |
var Sel = document.selection.createRange(); | |
var SelLength = document.selection.createRange().text.length; |
OlderNewer