Skip to content

Instantly share code, notes, and snippets.

@uhop
uhop / perf.js
Created August 12, 2011 07:35
dojo/array.js: forEach
// dojo/array.js: forEach
/*
LEGEND:
old --- the previous implementation from Dojo trunk.
nnn --- the new implementation.
ech --- https://github.com/kriszyp/each
NOTES:
All functions are copied below together with all necessary utility functions.
All tests are performed with and without the context (thisObject).
@uhop
uhop / perf.js
Created August 12, 2011 09:01
dojo/array.js: indexOf
// dojo/array.js: forEach
/*
LEGEND:
old --- the previous implementation from Dojo trunk.
nnn --- the new implementation.
ech --- https://github.com/kriszyp/each
NOTES:
All functions are copied below together with all necessary utility functions.
*/
@uhop
uhop / gist:3259255
Created August 4, 2012 18:41
Bezier Shaders & Vector openGL rendering
@uhop
uhop / perf.js
Created August 14, 2012 15:48
Benchmarking creating an object
// Creating different objects.
var z = 5;
this.group(
"Primitives",
function Nothing(x) { return; },
function Null(x) { return null; },
function Boolean(x) { return true; },
function Number(x) { return 1; },
@uhop
uhop / gist:3351030
Created August 14, 2012 17:29 — forked from idan/gist:3135754
A Sample Post

Hello there! This is a sample post for gist.io, a super-lightweight writing soapbox for hackers.

Now look up. Further. Above the post title. See that grey text with the gist ID?

Now back to me. That grey text is a link! Open that sucker in a new tab to see the source for this post. Also, I'm on a horse.

This is a major heading

If you peek at it with a web inspector, you'll see that it is a second-level heading. You can use first level headings, but they'll look just like the second level ones, and the gods of the HTML5 outlining algorithm will frown upon you.

@uhop
uhop / minified.js
Last active December 15, 2015 18:19
UMD header
/* UMD.define */ (typeof define=="function"&&define||function(d,f,m){m={module:module,require:require};module.exports=f.apply(null,d.map(function(n){return m[n]||require(n)}))})
(["module", "../main"], function(module, unit){
// module's code
});
/* UMD.require */ (typeof define=="function"&&require||function(d,f,m){m={module:module,require:require};f.apply(null,d.map(function(n){return m[n]||require(n)}))})
(["module", "../main"], function(module, unit){
// module's code
});
* + table {
border-style:solid;
border-width:1px;
border-color:#e7e3e7;
}
* + table th, * + table td {
border-style:dashed;
border-width:1px;
border-color:#e7e3e7;
@uhop
uhop / nginx-webp-sample.conf
Last active November 3, 2023 12:09
Serving WEBP with nginx conditionally.
user www-data;
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
Verifying that +elazutkin is my blockchain ID. https://onename.com/elazutkin
@uhop
uhop / print.html
Last active November 29, 2022 23:35
The way to print slides as PDF.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Multi-page print test</title>
<!--
Print to PDF, landscape, letter size, no margins, enable background graphics.
Tested on Chrome.
-->
<style>