Skip to content

Instantly share code, notes, and snippets.

@jneem
jneem / -
Created October 6, 2015 19:34
https://gist.github.com/c81015a042a5be2d84cf.git
!function(){function n(n){return n&&(n.ownerDocument||n.document||n).documentElement}function t(n){return n&&(n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView)}function e(n,t){return t>n?-1:n>t?1:n>=t?0:0/0}function r(n){return null===n?0/0:+n}function u(n){return!isNaN(n)}function i(n){return{left:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)<0?r=i+1:u=i}return r},right:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)>0?u=i:r=i+1}return r}}}function o(n){return n.length}function a(n){for(var t=1;n*t%1;)t*=10;return t}function c(n,t){for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}function l(){this._=Object.create(null)}function s(n){return(n+="")===pa||n[0]===va?va+n:n}function f(n){return(n+="")[0]===va?n.slice(1):n}function h(n){return s(n)in this._}function g(n){return(n=s(n))in this._&&delete this._[n]}function p(){var n=[]
/*! URI.js v1.16.1 http://medialize.github.io/URI.js/ */
/* build contains: URI.js */
(function(n,v){"object"===typeof exports?module.exports=v(require("./punycode"),require("./IPv6"),require("./SecondLevelDomains")):"function"===typeof define&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],v):n.URI=v(n.punycode,n.IPv6,n.SecondLevelDomains,n)})(this,function(n,v,t,h){function d(a,b){var c=1<=arguments.length,f=2<=arguments.length;if(!(this instanceof d))return c?f?new d(a,b):new d(a):new d;if(void 0===a){if(c)throw new TypeError("undefined is not a valid argument for URI");
a="undefined"!==typeof location?location.href+"":""}this.href(a);return void 0!==b?this.absoluteTo(b):this}function q(a){return a.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function w(a){return void 0===a?"Undefined":String(Object.prototype.toString.call(a)).slice(8,-1)}function k(a){return"Array"===w(a)}function C(a,b){var c={},d,g;if("RegExp"===w(b))c=null;else if(k(b))for(d=0,g=b.length;d<g;d++)c[b[d]]=!0;else c[b]=!
@jneem
jneem / Cargo.toml
Last active March 27, 2020 18:32
Rectangle overflow
[package]
name = "druid-rectangle"
version = "0.1.0"
authors = ["Joe Neeman <joeneeman@gmail.com>"]
edition = "2018"
[dependencies]
druid = { git = "https://github.com/xi-editor/druid.git" }
[package]
name = "gst-test"
version = "0.1.0"
authors = ["Joe Neeman <joeneeman@gmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
gstreamer = "0.15.4"
@jneem
jneem / main.rs
Created February 24, 2022 22:23
#![feature(bench_black_box)]
use rand::rngs::SmallRng;
use rand::{Rng, SeedableRng};
use std::hint::black_box;
use std::time::{Duration, Instant};
fn main() {
for error_rate in [0, 1, 10, 100] {
println!(
"sqrt {}: {:?}",
// Guaranteed to return a value strictly bigger than x (as long as x is finite).
// If x is infinite, will drain the list and then return infinity.
double next(list<double> *const ys, double x)
{
while (!s->empty())
{
double y = /* some computation depending on x and ys->front() */;
if (y > x)
return y;
s->pop_front();