nothingjs

nothingjs

The Smallest Javascript Library In The Solar System

git alias finder (aka: git finda)

A long time ago, I had found Brett Terpstra’s One git Alias To Rule Them All. His alias, git finda [text], prints a nicely formatted table consisting of all git aliases you have defined. This worked well on Mac OSX, but the printf statements to pad/justify the alias name never worked for me on either Windows or Linux. I’ve tweaked his alias slightly and ended up with something that works on both Windows and Linux.

[alias]
finda = "!grepalias() { git config --global --get-regexp alias | grep -i \"$1\" | awk -v nr=2 '{sub(/^alias\\./,\"\")};{printf \"\\033[31m%12.12s\\033[1;37m\", $1};{sep=FS};{for (x=nr; x< =NF; x++) {printf \"%s%s\", sep, $x; }; print \"\\033[0;39m\"}'; }; grepalias"

Pianette

The concept: If you are a good pianist, then you will be good at this version of Street Fighter.

The project has a really nice writeup on foobarfiles.

Seed RequestPolicy from 1Password

I recently rebuilt my laptop from scratch, and while installing the most excellent NoScript, someone suggested to install RequestPolicy as a companion extension. I have played with RequestPolicy in the past but ended up uninstalling it for one reason or another. I was about to uninstall it again after having to continuously toggle policies on things for new websites I visited (this being a fresh install of everything).

I decided to try to seed RequestPolicy with a list of domains from 1Password. Both 1Password and RequestPolicy have plain-text import/export mechanisms, so I fired up ruby and wrote a simple little script to take the 1Password export of the ‘URL/Location’ field, and convert it to a format which RequestPolicy likes.

In order to use the following script, you will need the following:

1. Ruby
2. This Gist
3. Export ONLY your 1Password ‘URL/Location’ field. Open 1Password and click on the File -> Export All -> Text File… and uncheck all but the ‘URL/Location’ field. (This is very tedious, but you only have to do it once)

Export 'URL/Location' field

Once you are set, fire up the script like so:

# chmod u+x 1p2rp.rb
# ./1p2rp.rb --in /path/to/1password/export.file --out /path/to/save/request_policy_import.file

Once complete, import /path/to/save/request_policy_import.file into RequestPolicy using the Import function of the extension. Enjoy your 1Password saved websites being white-listed by default.

Chile Colorado

Yesterday we went to our local Cha Cha Cha where I discovered this wonderful burrito dubbed the Chile Colorado, which consisted of slow cooked beef in guajillo sauce. I never knew this flavor existed before!

Homemade Tomato Cages

These were relatively simple to make, and very cheap too.

What you will need:

  • Drill, drill bits, and screwdriver attachment
  • Miter saw or comparable
  • Tape Measure
  • Square (optional)
  • 1×2-48″ Stakes (4)
  • #8×1″ Wood Screws (12)
  • #10×2″ Metal Screws with nuts (2)
  • 1×2″ board or comparable for the crossbeams

The 48″ stakes are perfectly tall enough for a decent tomato cage, so there is no cutting involved. For the cross beams, you need to choose a width that works for you. I choose 14″.

Cut 3 lengths of the 1×2″ board to your desired width. These will make the cross beams for your “short” side. In order for the cage to hinge, you will also make a “long” side, by adding double the depth of the Stakes. My Stakes were 5/8″ deep, so I added 1 1/4″ to create three (3) 15 1/4″ lengths.

Line your steaks up so that the square tops are even with each other. Measure out 3 lines semi-evenly down the length of the stake. Place the butt-end of the cut crossbeam on the line and draw a second line so that you can tell where the crossbeam will attach to the stake.

At the square end of each stake, drill a single hole wide enough to let the metal screw fit. Change your drill bit to a size better suited for the wood screws and Drill two holes side by side in each “box” you made while measuring where your crossbeams will sit.

Take 2 of your stakes, and the 3 “short” lengths of crossbeam and screw them together (make sure that the pointy side of the stakes both face the same direction…)

Do the same for the “long” lengths.

All that is left is to attach both sides together with the metal screws and nuts.