Skip to content

Instantly share code, notes, and snippets.

View thegrandpoobah's full-sized avatar

Sahab Yazdani thegrandpoobah

View GitHub Profile
@thegrandpoobah
thegrandpoobah / _.retry.js
Created May 5, 2011 14:34
Retry mixin for Underscore.js
_.mixin({
// Polls condition indefinitely every N milliseconds and executes
// a function once the condition has passed.
retry: function(func, cond, wait) {
var args = slice.call(arguments, 3);
if (cond()) {
func.apply(this, args);
} else {
_.delay.apply(this, [_.retry, wait, func, cond, wait].concat(args));
}
@thegrandpoobah
thegrandpoobah / datatable_scrollbug.html
Created August 10, 2011 15:59
Scrollable table in position:absolute container is sized weird.
<html>
<head>
<script src="media/js/jquery.js" type="text/javascript"></script>
<script src="media/js/jquery.dataTables.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
$('#awesome').dataTable({
bPaginate: false
, bSort: false
, bAutoWidth: true
"[{"name":"Portfolio",
"prices":[
{
"end":"2016-01-03T05:00:00.000Z",
"open":0.9475496789539849,
"close":0.9475496789539849,
"index":1
},
{
"end":"2016-01-04T05:00:00.000Z",
Application Basics
------------------
Name: Pale Moon
Version: 26.0.3
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:38.9) Gecko/20100101 Goanna/2.0 Firefox/38.9 PaleMoon/26.0.3
Extensions
----------

This is a markdown text

This is also markdown text

@thegrandpoobah
thegrandpoobah / gist:33745a53308edfd3543c7b494a9b0d72
Created November 17, 2023 19:54
pseudocode for radius search in quadtrees
function doRectanglesIntersert(r1_x0, r1_y0, r1_x1, r1_y1, r2_x0, r2_y0, r2_x1, r2_y1) {
// magic
}
function pointInRectangle(x0, y0, x1, y1, qx, qy) {
// magic
}
function pointInCircle(cx, cy, radius, qx, qy) {
// magic