Skip to content

Instantly share code, notes, and snippets.

@SgtPooki
SgtPooki / SketchSystems.spec
Last active April 19, 2019 22:52
MyElement
MyElement
Hover
HStill
HMoving
onMouseOut -> MouseOutside
onMouseMove -> HMoving
onMouseStop -> HStill
MouseOutside*
onMouseEnter -> HMoving
@SgtPooki
SgtPooki / findVersions.js
Created August 4, 2018 06:56
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
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 August 4, 2018 06:55
Find names and versions of root modules and typings in your project.
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 January 11, 2018 22:53
Tree Style Tab - top tab bar removal
#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 June 7, 2019 18:45
Script to automatically download free ebooks listed on oreilly
/*
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/
@SgtPooki
SgtPooki / promiseDebounce.js
Created June 18, 2015 20:27
debounced promise
/*
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 April 15, 2015 00:39
A module that decorates a passed in object with on, off, and trigger functions.
/**
* @fileOverview
* @author Russell Dempsey <SgtPooki@gmail.com>
* 2015
*/
'use strict';
var Decoration = {};
@SgtPooki
SgtPooki / mcoords.js
Created April 11, 2015 05:04
Display mouse coordinates
(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 April 2, 2015 15:30
Recursive Bezier function
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 February 21, 2015 00:14
The settings file for cmder with saved layout
<?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"/>