Skip to content

Instantly share code, notes, and snippets.

@ekashida
ekashida / setup.js
Last active January 4, 2016 21:19
setup for perf testing yui loader
function getTime () {
return new Date().getTime();
}
function patchLoader (Y, loader) {
var YUI = Y.config.global.YUI,
seq = 0,
methods,
current,
perf,
@ekashida
ekashida / index.html
Last active January 4, 2016 21:19
perf test disable populate with both core and application modules
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>perf test disable populate with both core and application modules</title>
</head>
<body>
<script src="https://rawgithub.com/ekashida/8679996/raw/12ac7814ea05341584e47db16c6ddaf148fd31bf/setup.js"></script>
<script src="https://rawgithub.com/ekashida/yui3/perf-hooks-disable-populate-built/build/yui/yui-debug.js"></script>
<script src="https://s.yimg.com/zz/combo?os/mit/td/td-server-my-0.1.548/asset-loader-988bf153.js"></script>
@ekashida
ekashida / index.html
Last active January 4, 2016 21:18
perf test baseline with both core and application modules
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>perf test baseline with both core and application modules</title>
</head>
<body>
<script src="https://rawgithub.com/ekashida/8679996/raw/12ac7814ea05341584e47db16c6ddaf148fd31bf/setup.js"></script>
<script src="https://rawgithub.com/ekashida/yui3/perf-hooks-built/build/yui/yui-debug.js"></script>
<script src="https://s.yimg.com/zz/combo?os/mit/td/td-server-my-0.1.548/asset-loader-988bf153.js"></script>
@ekashida
ekashida / index.html
Last active January 4, 2016 20:59
perf test disable populate with only core modules
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>perf test disable populate with only core modules</title>
</head>
<body>
<script src="https://rawgithub.com/ekashida/8679996/raw/12ac7814ea05341584e47db16c6ddaf148fd31bf/setup.js"></script>
<script src="https://rawgithub.com/ekashida/yui3/perf-hooks-disable-populate-built/build/yui/yui-debug.js"></script>
<script>
@ekashida
ekashida / index.html
Last active January 4, 2016 10:19
perf test baseline with only core modules
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>perf test baseline with only core modules</title>
</head>
<body>
<script src="https://rawgithub.com/ekashida/8679996/raw/12ac7814ea05341584e47db16c6ddaf148fd31bf/setup.js"></script>
<script src="https://rawgithub.com/ekashida/yui3/perf-hooks-built/build/yui/yui-debug.js"></script>
<script>
(function (w, d, undefined) {
var srp = d.getElementById('srp');
// do something
}(window, document))
@ekashida
ekashida / gist:6391773
Created August 30, 2013 16:35
Inheriting default combo configs
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<script src="http://yui.yahooapis.com/3.11.0/build/yui/yui-debug.js"></script>
<script>
YUI({
<!DOCTYPE html>
<html>
<body>
<div id=foo></div>
<script src="http://yui.yahooapis.com/3.11.0/build/yui/yui-min.js"></script>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Computed values of scoped CSS</title>
</head>
<body>
<div>
This text should be visible. It should not have a green background color.
</div>
@ekashida
ekashida / prime.py
Created July 4, 2013 00:24
Find the 1000th prime number without defining any functions
# Check for primes starting at 2 since 1 is not prime by definition
number = 2
# Store all primes in this list
primes = []
# Keep looking for primes until we find 1000 of them
while len(primes) < 1000:
# Assume the number is prime until proven otherwise
is_prime = True