Skip to content

Instantly share code, notes, and snippets.

Workin' in Autodesk's private repos...

Philip Blyth nemoDreamer

Workin' in Autodesk's private repos...
Block or report user

Report or block nemoDreamer

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
bdougherty /
Last active Dec 28, 2019
Play the Benny Hill theme song while installing npm modules

Add the function somewhere to your dotfiles. Works better if you npm install -g benny-hill first.

View gist:472fb73184bcb3ea11a2
var reducePath = function (x, y, entryOffset, rangeOffset, entryRequiredWall, entryDisallowedWall) {
var rangeEntryRequiredDirections = [entryDisallowedWall, OppositeDirections[entryDisallowedWall]];
var rangeEntryDisallowedDirections = [entryRequiredWall, OppositeDirections[entryRequiredWall]];
var endDisallowedDirections = [OppositeDirections[entryRequiredWall], OppositeDirections[entryDisallowedWall]];
var endRequiredDirections = [entryRequiredWall, entryDisallowedWall];
var tile = tiles[x][y];
var color = tile.color;
var entry = tiles[x+entryOffset[0]][y+entryOffset[1]];
nemoDreamer / 01_user_function.less
Last active Aug 29, 2015
User function approximation in server-side LESS (and a true greyscale "function")
View 01_user_function.less
@color: #f88;
/* LESS admits that their greyscale function doesn't respect relative lightness */
.bad_grayscale {
original-color: @color;
desaturated: desaturate(@color, 100%);
greyscaled: greyscale(@color); // synonymous
BEGIN{s,,=]=>%-{<-|}<&|`{,,y; -/:-@[-`{-};`-{/' -;,s,(.+)'$,$1*',&&s&&$_&gesex}
View Node-Red on Heroku
Challenge: deploy node-red to a heroku endpoint.
First challenge -- you have to have red.js listen on process.env.PORT rather than 1880.
Second challenge -- web sockets -- node-red uses web sockets, so the server comes up and disconnects right away.
When you enable the lab:websockets it doesn't fix it out of the box.
slevithan / xregexp-lookbehind2.js
Created Apr 14, 2012
Simulating lookbehind in JavaScript (take 2)
View xregexp-lookbehind2.js
// Simulating infinite-length leading lookbehind in JavaScript. Uses XRegExp.
// Captures within lookbehind are not included in match results. Lazy
// repetition in lookbehind may lead to unexpected results.
(function (XRegExp) {
function prepareLb(lb) {
// Allow mode modifier before lookbehind
var parts = /^((?:\(\?[\w$]+\))?)\(\?<([=!])([\s\S]*)\)$/.exec(lb);
return {
leegrey /
Created Nov 11, 2011
TileWorld - Ray Casting in a Grid
// - Lee Grey, November 2011
import com.lgrey.vectors.LGVector2D;
import flash.display.BitmapData;
public class TileWorld
protected var _worldMap:BitmapData;
isaacs /
Last active Apr 2, 2020
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl | sh

Example: You have a branch refactor that is quite different from master. You can't merge all of the commits, or even every hunk in any single commit or master will break, but you have made a lot of improvements there that you would like to bring over to master.

Note: This will not preserve the original change authors. Only use if necessary, or if you don't mind losing that information, or if you are only merging your own work.

On master:

> git co -b temp
You can’t perform that action at this time.