Skip to content

Instantly share code, notes, and snippets.

@Rooster212
Rooster212 / elementsFromPoint.js
Last active February 10, 2021 11:51 — forked from oslego/elementsFromPoint.js
Gets all elements below the specified point. Checks to see if browser already has method before using a manual method. Originally found https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/dTYbg4_S2b8/bEtoAnkP0swJ
// returns a list of all elements under the cursor
//
function elementsFromPoint(x,y) {
var elements = [], previousPointerEvents = [], current, i, d;
if(typeof document.elementsFromPoint === "function")
return document.elementsFromPoint(x,y);
if(typeof document.msElementsFromPoint === "function")
return document.msElementsFromPoint(x,y);
@onlytiancai
onlytiancai / python_infrastructure.md
Created October 12, 2012 08:55
python 基础设施讨论贴

python项目通用组件和基础服务

很多公司都大量使用了python,其中有一些开发规范,code guidline, 通用组件,基础框架是可以共用的。

每个公司都自己搞一套, 太浪费人力,我想开一帖和大家讨论一下这些python基础设施的搭建。

原则是我们尽量不重新发明轮子,但开源组件这么多,也要有个挑选的过程和组合使用的过程,在这里讨论一下。

另一方面,有些开源组件虽然强大,但我们不能完全的驾驭它,或只使用其中很少的一部分,我们就可以考虑用python实现一个简单的轮子,可控性更强,最好不要超过300行代码。

@ericmoritz
ericmoritz / README.rst
Created May 13, 2011 15:07
tnetstring shootout

I was a bit skeptical about a new data format call tnetstring. It claims to be both human and machine readable. They claim that a parser is easier to built for a tnetstring and therefore is better. In fact, while the implementation of the parser may be easier, human readability suffers with negligible speed gains.

I assert that if human readability is harmed in favor of speed, then you would be much better off using a binary solution such as Protobufs.

Results

Time is in milliseconds: