Skip to content

Instantly share code, notes, and snippets.

(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;
}
//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
@felixlaumon
felixlaumon / jquery-fastdom-promise.js
Created November 12, 2013 05:19
jquery-fastdom-promise
$.when($('#id').height(), $('#id').width(), function (height, width) {
});
// instead of
$('#id').height(function (height) {
$('#id').width(function (width) {
});
<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';
@felixlaumon
felixlaumon / rivets-each-binder.js
Created July 17, 2013 11:35
Rivets.js each=* binder in JavaScript
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 = [];
<!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>