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.tmpl = function(template, data){ | |
var _ = { | |
cache: {}, | |
// John Resig - simple html template | |
render: function render(template, data) { | |
// Figure out if we're getting a template, or if we need to | |
// load the template - and be sure to cache the result. | |
var fn = !/\W/.test(template) ? | |
_.cache[template] = _.cache[template] || | |
render(document.getElementById(template).innerHTML) : |
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
assert(block.hashMerkleRoot == uint256("0x38ca78a781d3c571a681ea2241ffb1e0d89bd1ecd3499f1bf6edeaa8751e7151")); | |
// If genesis block hash does not match, then generate new genesis hash. | |
if (false && block.GetHash() != hashGenesisBlock) | |
{ | |
printf("Searching for genesis block...\n"); | |
// This will figure out a valid hash and Nonce if you're | |
// creating a different genesis block: | |
uint256 hashTarget = CBigNum().SetCompact(block.nBits).getuint256(); | |
uint256 thash; |
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
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.6.0/underscore-min.js"> | |
<script> | |
(function (global, jQuery, underscore) { | |
global._$ = global._$ || function(){ | |
Object.getOwnPropertyNames(underscore).forEach(function(property) { | |
if(typeof underscore[property] == 'function'){ | |
(function(){ | |
jQuery[property] = function(){ | |
return underscore[property].apply(0, arguments); |
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
enyo.kind({ | |
name: "WrappedLeftRightArranger", | |
kind: "LeftRightArranger", | |
start: enyo.inherit(function(sup) { | |
return function() { | |
sup.apply(this, arguments); | |
var s = this.container.fromIndex; | |
var f = this.container.toIndex; | |
var c$ = this.getOrderedControls(f); | |
var o = Math.floor(c$.length/2); |
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
enyo.kind({ | |
name: "b3.Style", | |
tag: "style", | |
styles:[], | |
create: function(){ | |
//create style strings from each inner components style objects | |
enyo.forEach(this.components, function(style){ | |
var innerStyles = []; | |
for (var property in style.style) { | |
if (style.style.hasOwnProperty(property)) { |
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 (enyo, scope) { | |
/** | |
* Fires when element stops fetching [media]{@link enyo.Media} data before it is | |
* completely downloaded, but not due to an error. | |
* | |
* @event enyo.Media#event:onAbort | |
* @type {Object} | |
* @property {Object} sender - The [component]{@link enyo.Component} that most recently | |
* propagated the [event]{@link external:event}. | |
* @property {Object} event - An [object]{@link external:Object} containing |
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(enyo, scope){ | |
/** | |
* _enyo.Once_ returns a function that will only be executed one time no matter | |
* how many times it was called. | |
* | |
* borrowed from underscore | |
* | |
* @class enyo.Once | |
* @public |
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 merge(target, src) { | |
//quickly merge all values from | |
//retrieved data into the store | |
Object.keys(src).forEach(function (key) { | |
if (typeof src[key] !== 'object' || !src[key]) { | |
target[key] = src[key]; | |
} else { | |
if (!target[key]) { | |
target[key] = src[key]; |
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 strict'; | |
module.exports = function(template, data) { | |
this.data = function(data) { | |
this.oldnode = this.node; | |
for (var k in data) { | |
this[k] = data[k]; | |
}; | |
this.tag = this.tag || 'div'; |
OlderNewer