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
<h1>Hello {{ name }}!</h1> |
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 DefaultController extends Controller | |
{ | |
/** | |
* @Route("/hello/{name}") | |
* @Template() | |
*/ | |
public function indexAction($name) | |
{ | |
return array('name' => $name); | |
} |
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
<span data-picture data-alt="A giant stone face at The Bayon temple in Angkor Thom, Cambodia"> | |
<span data-src="small.jpg"></span> | |
<span data-src="small_x2.jpg" data-media="(min-device-pixel-ratio: 2.0)"></span> | |
<span data-src="medium.jpg" data-media="(min-width: 400px)"></span> | |
<span data-src="medium_x2.jpg" data-media="(min-width: 400px) and (min-device-pixel-ratio: 2.0)"></span> | |
<span data-src="large.jpg" data-media="(min-width: 800px)"></span> | |
<span data-src="large_x2.jpg" data-media="(min-width: 800px) and (min-device-pixel-ratio: 2.0)"></span> | |
<span data-src="extralarge.jpg" data-media="(min-width: 1000px)"></span> | |
<span data-src="extralarge_x2.jpg" data-media="(min-width: 1000px) and (min-device-pixel-ratio: 2.0)"></span> |
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
<script src="https://raw.github.com/scottjehl/picturefill/master/picturefill.js"></script> | |
<span data-picture data-alt="GlynRob in cartoon form"> | |
<span data-src="images/small.jpg"></span> | |
<span data-src="images/medium.jpg" data-media="(min-width: 400px)"></span> | |
<span data-src="images/large.jpg" data-media="(min-width: 800px)"></span> | |
<span data-src="images/extralarge.jpg" data-media="(min-width: 1000px)"></span> | |
<!-- Fallback content for non-JS browsers. Same img src as the initial, unqualified source element. --> | |
<noscript><img src="images/small.jpg" alt="GlynRob in cartoon form"></noscript> | |
</span> |
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
var calculation = _.memoize(function(n) { | |
return n * 100; | |
}); | |
calculation(2) |
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
var addDelivery = function(value){ return value + 5; }; | |
var addTax = function(value){ return value*1.175; }; | |
var calcCost = _.compose(addDelivery, addTax); | |
calcCost(12) |
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
_.mixin({ | |
capitalize: function(string) { | |
return string.charAt(0).toUpperCase() + string.substring(1).toLowerCase(); | |
} | |
}); | |
var capitalizetext = _("sample text").capitalize(); |
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
<div class="page"></div> | |
<script type="text/template" id="title-template"> | |
<br class="clear" /> | |
<div class="row"> | |
<h3><%= header %></h3> | |
</div> | |
</script> | |
<script> | |
var template = _.template($('#title-template').html(), {header:'COLLECTIONS'}); |
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
// CRYPTOJS | |
var encrypted = CryptoJS.TripleDES.encrypt(secretString, password); | |
var decrypted = CryptoJS.TripleDES.decrypt(encrypted.toString(), password); | |
// SJCL | |
var encrypted = sjcl.encrypt(password, secretString); | |
var decrypted = sjcl.decrypt(password, encrypted); |
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
/* POLYCRYPT HASH */ | |
function polycryptHash(){ | |
var polystring=util.str2abv(password); | |
var op=window.polycrypt.digest("SHA-256",polystring); | |
op.oncomplete=function(e){ | |
var hex=util.abv2hex(e.target.result); | |
// hex is the hash | |
} | |
} | |
window.polycrypt.onalive=polycryptHash; |