Add the function somewhere to your dotfiles. Works better if you npm install -g benny-hill
first.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Challenge: deploy node-red to a heroku endpoint. | |
2013/12/27 | |
First challenge -- you have to have red.js listen on process.env.PORT rather than 1880. | |
https://devcenter.heroku.com/articles/getting-started-with-nodejs | |
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. | |
https://blog.heroku.com/archives/2013/10/8/websockets-public-beta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:pizza::cloud::cloud::cloud::cloud::cloud::cloud::cloud::cloud::pizza::pizza::pizza::pizza::pizza::cloud::cloud::pizza::pizza::pizza::pizza::pizza::pizza::pizza::cloud::pizza::cloud::cloud::cloud::cloud::cloud::pizza::cloud: | |
:pizza::cloud::cloud::cloud::cloud::cloud::cloud::cloud::pizza::cloud::cloud::cloud::cloud::cloud::pizza::cloud::cloud::cloud::cloud::pizza::cloud::cloud::cloud::cloud::pizza::pizza::cloud::cloud::cloud::pizza::pizza::cloud: | |
:pizza::cloud::cloud::cloud::cloud::cloud::cloud::cloud::pizza::cloud::cloud::cloud::cloud::cloud::cloud::cloud::cloud::cloud::cloud::pizza::cloud::cloud::cloud::cloud::pizza::cloud::pizza::cloud::pizza::cloud::pizza::cloud: | |
:pizza::cloud::cloud::cloud::cloud::cloud::cloud::cloud::pizza::cloud::cloud::pizza::pizza::pizza::pizza::cloud::cloud::cloud::cloud::pizza::cloud::cloud::cloud::cloud::pizza::cloud::cloud::pizza::cloud::cloud::pizza::cloud: | |
:pizza::cloud::cloud::cloud::cloud::cloud::cloud::cloud::pizza::cloud::cloud::cloud::cloud::cloud::pizza::cloud::cloud::clou |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TileWorld.as - Lee Grey, November 2011 | |
package com.lgrey.game.tileEngine | |
{ | |
import com.lgrey.vectors.LGVector2D; | |
import flash.display.BitmapData; | |
public class TileWorld | |
{ | |
protected var _worldMap:BitmapData; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN{s,,=]=>%-{<-|}<&|`{,,y; -/:-@[-`{-};`-{/' -;,s,(.+)'$,$1*',&&s&&$_&gesex} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Remove trailing whitespace from files in the src directory. | |
# This is useful because (for example) trailing whitespace hinders Vim's | |
# paragraph movement. | |
# INFO: http://stackoverflow.com/a/4438318/574190 | |
# INFO: http://stackoverflow.com/q/1583219/574190 | |
# The directory under which we want to search for files. | |
ROOT_DIRECTORY="$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]]; |
Update 2022: git checkout -p <other-branch>
is basically a shortcut for all this.
FYI This was written in 2010, though I guess people still find it useful at least as of 2021. I haven't had to do it ever again, so if it goes out of date I probably won't know.
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.
OlderNewer