Skip to content

Instantly share code, notes, and snippets.

@PizzaBrandon
PizzaBrandon / intersectbug.js
Created May 25, 2018
turf/intersect 6.1.2 bug
View intersectbug.js
const feature1 = {
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[-85.42358091, 41.76872876],
[-85.42358054, 41.76871738],
[-85.42343269, 41.76871941],
[-85.42342892, 41.7687873],
@PizzaBrandon
PizzaBrandon / extend.sh
Created May 17, 2018 — forked from wvengen/extend.sh
Extend non-HiDPI external display above HiDPI internal display
View extend.sh
#!/bin/sh
# extend non-HiDPI external display on DP* above HiDPI internal display eDP*
# see also https://wiki.archlinux.org/index.php/HiDPI
# you may run into https://bugs.freedesktop.org/show_bug.cgi?id=39949
# https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/883319
EXT=`xrandr --current | sed 's/^\(.*\) connected.*$/\1/p;d' | grep -v ^eDP | head -n 1`
INT=`xrandr --current | sed 's/^\(.*\) connected.*$/\1/p;d' | grep -v ^DP | head -n 1`
ext_w=`xrandr | sed 's/^'"${EXT}"' [^0-9]* \([0-9]\+\)x.*$/\1/p;d'`
View omitDeep.js
// Depends on lodash.cloneDeepWith
// This example assumes excludeKeys is an array
function omitDeep(collection, excludeKeys) {
function omitFn(value) {
if (value && typeof value === 'object') {
excludeKeys.forEach((key) => {
delete value[key];
View smartresize.js
(function($,sr){
// debouncing function from John Hann
// http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
var debounce = function (func, threshold, execAsap) {
var timeout;
return function debounced () {
var obj = this, args = arguments;
function delayed () {
@PizzaBrandon
PizzaBrandon / jquery.waituntilexists.js
Last active Sep 26, 2020 — forked from buu700/jquery.waituntilexists.js
Updated waitUntilExists plugin
View jquery.waituntilexists.js
;(function ($, window) {
var intervals = {};
var removeListener = function(selector) {
if (intervals[selector]) {
window.clearInterval(intervals[selector]);
intervals[selector] = null;
}
You can’t perform that action at this time.