Skip to content

Instantly share code, notes, and snippets.

View benlk's full-sized avatar
🏡
Working from home

Ben Keith benlk

🏡
Working from home
View GitHub Profile
@benlk
benlk / .sh
Last active August 29, 2015 14:28
# From https://twitter.com/addyosmani/status/633405466094120960
!! # run the last command executed
sudo !! # run the last command, but as root
!<word> # run the last command that started with the word
!<word>:p # List, but don't run that last command. :p is like "print"
<space>command # execute a command without saving it in history
echo "ls -l" | at midnight # execute command at a given time. `man at` has come really nice examples.
ls -lhS # sort files by sizes in directory
top -o vsize # why is your computer slow

Do you:

  • open 1Password.html on Dropbox.com to access your shared passwords?
  • receive a 403 error about being unable to load data/default/encryption-keys.js?
  • have your Dropbox folder on your machine, say at ~/Dropbox?
  • have Python installed?

Here's how to get access to your passwords:

  1. Open a terminal
@benlk
benlk / signs.md
Last active August 29, 2015 14:24
How much would it cost to put "Walk Left | Stand Right" signs in the DC Metro
Cost of signs x number of signs

Cost of signs

According to this site, figure $20 per square foot.

How large should the "Walk Left | Stand Right" sign be? Let's say four feet wide and one foot tall. 4 sq. ft per sign.

$80 per sign, plus mounting brackets, so let's call it an even $100 per sign.

@benlk
benlk / recipe.md
Last active August 29, 2015 14:22
Bacon pancake recipe
  1. Make a batch of thicker pancake batter. If your pancakes are normally a quarter of an inch thick, you're good. if they're thinner, use less milk or water.
  2. Cut your normal-length bacon strips into half-length strips.
  3. Cook the bacon until it is done but soft. Drain the griddle.
  4. Put two strips side-by-side.
  5. Pour the batter over the bacon, right in the bacon grease.
  6. Flip the pancakes as usual.
  7. Serve with a spoonful of butter, or with syrup.

If you're feeling adventurous, use chocolate chips in the batter.

@benlk
benlk / 0-deprecated.md
Last active October 23, 2015 22:34
Updating largo-umbrella with a new commit

Check out inn/docs, folder projects/largo

This gist is out of date.

@benlk
benlk / reddits.js
Created April 12, 2015 20:10
A way to generate all the country code reddit domains, and then some.
// Why? Because I wanted to blacklist them in my /etc/hosts file.
// This does not cover the subredditname.reddit.com subdomains, but those redirect to www.reddit.com/r/subredditname
var letters = Array(
'a',
'b',
'c',
'd',
'e',
'f',
@benlk
benlk / 0-toc.md
Last active March 29, 2023 13:13
Collection of notes on WP_UnitTestCase
  1. Table of contents
  2. General information
    1. Terms
    2. General structure of a test
    3. WordPress-specific assertions and test functions
      • enqueues
      • creating posts
      • creating terms
      • attaching images
  • ?
@benlk
benlk / CSS
Last active August 29, 2015 14:16
How XKCD What If? does tooltip text.
/* the reference tooltips style starts here */
.ref {
position: relative;
vertical-align: baseline;
}
.refnum {
position: relative;
left: 2px;
@benlk
benlk / steps.md
Created March 12, 2015 18:37
Debugging things in WordPress
  • is it in The Loop?
    • should it be in the Loop?
    • is it Loop-agnostic?
    • can it be made Loop-agnostic?
  • are filters messing with the query?
@benlk
benlk / README.md
Last active August 29, 2015 14:16
if `pip install tarbell` fails with a message about gnureadline on Ubuntu

If pip install tarbell fails with an error that looks like this:

Command "/home/benlk/.virtualenvs/gene-wolfe/bin/python -c "import setuptools,
tokenize;__file__='/tmp/pip-build-pJSsCN/gnureadline/setup.py';exec(compile(getattr(
tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))"
install --record /tmp/pip-WluX7C-record/install-record.txt --single-version-externally-managed
--compile --install-headers /home/benlk/.virtualenvs/gene-wolfe/include/site/python2.7" 
failed with error code 1 in /tmp/pip-build-pJSsCN/gnureadline

You probably don't have the development headers for linbncurses