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
<!doctype> | |
<html> | |
<head> | |
<script src="/app/components/rivets/dist/rivets.js"></script> | |
<script src="/app/components/ChangeSummary/change_summary.js"></script> | |
<script src="/app/components/lodash/lodash.js"></script> | |
</head> | |
<body> | |
<ul> |
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
rivets.binders['each-*'] = { | |
block: true, | |
bind: function (el) { | |
var attr = ['data', this.view.config.prefix, this.type] | |
.join('-') | |
.replace('--', '-'); | |
var declaration = el.getAttribute(attr); | |
var comment = ' rivets: ' + this.type + ' '; | |
this.iterated = []; |
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 type='text/javascript'> | |
var googletag = googletag || {}; | |
googletag.cmd = googletag.cmd || []; | |
(function() { | |
var gads = document.createElement('script'); | |
gads.async = true; | |
gads.type = 'text/javascript'; | |
var useSSL = 'https:' == document.location.protocol; | |
gads.src = (useSSL ? 'https:' : 'http:') + | |
'//www.googletagservices.com/tag/js/gpt.js'; |
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
$.when($('#id').height(), $('#id').width(), function (height, width) { | |
}); | |
// instead of | |
$('#id').height(function (height) { | |
$('#id').width(function (width) { | |
}); |
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
//CodePen Evaluation License | |
// | |
//Copyright (c) 2013 Famo.us, Inc. | |
// | |
// Non-sublicensable permission is hereby granted, free of charge, | |
// to any person obtaining a copy of this software and associated | |
// documentation files directly from codepen.io (the "Software"), solely to | |
// internally make and internally use copies of the Software to test, | |
// explore, and evaluate the Software solely in such person’s non-commercial, | |
// non-production environments, provided that the above copyright |
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 () { | |
try { | |
var orcWidth = parseInt(window.location.search.match(/width=(\d+)/)[1], 10); | |
var orcHeight = parseInt(window.location.search.match(/height=(\d+)/)[1], 10); | |
var hasFailed = window.location.search.match(/oswidthheight=(\w+)/); | |
if (hasFailed && hasFailed.length) { | |
console.log('ignore width height verification because it has failed once before'); | |
return; | |
} |
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
// Wraps a promise-returning `fn` so that `fn` will only be invoked | |
// one after another (no 2 concurrent calls) | |
function sequential (fn) { | |
var lastPromise = $.Deferred().resolve().promise(); | |
return function () { | |
var context = this; | |
var args = arguments; | |
lastPromise = lastPromise.then(function () { | |
return fn.apply(context, args); |
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
gistup |
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
def helloworld(): | |
return 'helloworld' |
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
matrix = [ | |
[1,3,9,2], | |
[2,4,6,8] | |
] | |
vector = [2,3,6,5] | |
def dot_product (a, b): | |
return sum(map(lambda x: x[0] * x[1], zip(a, b))) |
OlderNewer