Skip to content

Instantly share code, notes, and snippets.

Avatar

Russell Dempsey SgtPooki

View GitHub Profile
View SketchSystems.spec
MyElement
Hover
HStill
HMoving
onMouseOut -> MouseOutside
onMouseMove -> HMoving
onMouseStop -> HStill
MouseOutside*
onMouseEnter -> HMoving
@SgtPooki
SgtPooki / findVersions.js
Created Aug 4, 2018
Find names and versions of root modules and typings in your project. This checks all package.json files (at the root level of the directories) and outputs the name and version found in the relevant package.json file
View findVersions.js
const glob = require('glob');
const globPromise = (string) => new Promise((resolve, reject) => {
glob(string, (error, result) => {
if (error) {
reject(error);
}
resolve(result);
});
});
@SgtPooki
SgtPooki / gist:b4e1d46d624ee0a0d0260d0819ae03c5
Created Aug 4, 2018
Find names and versions of root modules and typings in your project.
View gist:b4e1d46d624ee0a0d0260d0819ae03c5
const glob = require('glob');
const globPromise = (string) => new Promise((resolve, reject) => {
glob(string, (error, result) => {
if (error) {
reject(error);
}
resolve(result);
});
});
@SgtPooki
SgtPooki / userChrome.css
Created Jan 11, 2018
Tree Style Tab - top tab bar removal
View userChrome.css
#TabsToolbar {
visibility: collapse !important;
}
#main-window[tabsintitlebar]:not([sizemode="fullscreen"]) #TabsToolbar:not([collapsed="true"]) + #nav-bar:not(:-moz-lwtheme) {
background-clip: padding-box;
position: relative;
z-index: 1;
padding-left: 67px;
}
@SgtPooki
SgtPooki / getFreeOreillyBooks.js
Last active Jun 7, 2019
Script to automatically download free ebooks listed on oreilly
View getFreeOreillyBooks.js
/*
Just paste into your console.. or make a tampermonkey/greasemonkey script out of it.
Only tested in Chrome. Be careful.. three tabs are opened per book.
If a books image is not removed, you'll need to try to download that book yourself.
Use this script (enter into the console of your browser) on the following pages:
http://www.oreilly.com/programming/free/
http://www.oreilly.com/business/free/
View promiseDebounce.js
/*
Debounce promises.
Prevents multiple calls if the request is the same and either:
1. the promise has not resolved yet
2. a delay of {timeout} milliseconds has not passed since the last call
The call identity is dependent upon a key created with JSON.stringify(arguments)
*/
var debouncePromise = function debouncePromise(methodName, promise, throttleTimeout) {
@SgtPooki
SgtPooki / observableDecorator.js
Created Apr 15, 2015
A module that decorates a passed in object with on, off, and trigger functions.
View observableDecorator.js
/**
* @fileOverview
* @author Russell Dempsey <SgtPooki@gmail.com>
* 2015
*/
'use strict';
var Decoration = {};
@SgtPooki
SgtPooki / mcoords.js
Created Apr 11, 2015
Display mouse coordinates
View mcoords.js
(function() {
'use strict';
var $toolTip = $('<div/>');
$toolTip.addClass('customTooltip-rsd')
.css({
position: 'absolute',
display: 'inline-block',
'font-size': '22px',
backgroundColor: '#000',
color: '#ffffff',
@SgtPooki
SgtPooki / recursiveBezier.js
Created Apr 2, 2015
Recursive Bezier function
View recursiveBezier.js
var recursiveBezier = function recursiveBezier(pointArray, t) {
var P1;
var P2;
var inverse;
var length = pointArray.length;
if (length === 1) {
return pointArray[0];
} else {
P1 = recursiveBezier(pointArray.slice(0,length-1), t)
P2 = recursiveBezier(pointArray.slice(1), t);
@SgtPooki
SgtPooki / ConEmu-for-cmder.xml
Created Feb 21, 2015
The settings file for cmder with saved layout
View ConEmu-for-cmder.xml
<?xml version="1.0" encoding="utf-8"?>
<key name="Software">
<key name="ConEmu">
<key name=".Vanilla" modified="2015-02-20 18:12:53" build="140707">
<value name="ColorTable00" type="dword" data="00222827"/>
<value name="ColorTable01" type="dword" data="009e5401"/>
<value name="ColorTable02" type="dword" data="0004aa74"/>
<value name="ColorTable03" type="dword" data="00a6831a"/>
<value name="ColorTable04" type="dword" data="003403a7"/>
<value name="ColorTable05" type="dword" data="009c5689"/>
You can’t perform that action at this time.