Trey Piepmeier

Posts

Having preferences means having weaknesses.
Meaningful uncertainty is often a crucial component of real choice.

Ice Cube Celebrates The Eames

via > via

Maybe you’re stuck because you’re not listening for the times when the really good ideas come. Because when you’re extremely torqued up, and when you’re extremely anxious, and when you’re feeling really crappy about what you’re capable of, is the worst time in the world to do anything creative.
Merlin Mann (1:37:19)

1996

Thank you for reminding me of this, Jimmy.

Two of my heros.

theairtightgarage:

A talk with Hayao Miyazaki and Moebius, focusing on Miyazaki, filmed during their duel exhibit Miyazaki et Moebius: Deux Artistes Dont Les Dessins Prennent Vie in 2005.

… our effectiveness as designers is built on empathy, and the desire to show up and change things for the better, not just doing stuff and hoping not to screw it up.
Responsive Web Design


Photo by Jeremy Keith

This was a great overview of the world of Responsive Web Design. Of course, the phrase and this specific set of techniques was invented/curated by the author, so I (correctly) assumed it would be the very helpful guide that it is.

While you could get most of the technical know-how you need to use this technique by reading the A List Apart Article, this book goes into depth on the more subtle aspects. It also thoroughly answers the question “why should I use this?”, and even points out situations where RWD might not be ideal.

Each of the three ingredients of RWD are given their own chapter (the other two chapters of the book are the introduction and the summary—short and sweet).

  1. Flexible, Grid-Based Layout
    • This is your basic fluid/liquid layout with some grid goodness.
    • How to define things in relative measurements rather than pixels.
    • The formula: target ÷ context = result
      • target = the pixel dimensions you’re aiming for in your ideal layout
      • context = the area in which the target item is sitting
      • result = a huge, decimal-happy number such as 0.4583333333333333 that you put in your CSS (hopefully with a comment next to it showing how the number was derived.)
  2. Flexible Images
    • This stuff just seems magical. I especially love the technique of clipping images in certain circumstances.
  3. Media Queries
    • Before reading this book, this is the #1 thing that came to mind when the topic of Responsive Web Design came up. Of course, it is the magic sauce that gives the technique its main wow-factor, but it is only one third (although I would argue the most important third) of the technique.

While I understand the need to support older browsers, the depth to which this book goes in explaining how to get things to work in IE6 seemed quaint. I also was a little disappointed that he didn’t go whole hog and use HTML5. However, I understand that we can’t always use the new shiny things, so I don’t fault him too much for this.

The book ends with a (quite clever) recommendation of designing for the smallest screen first, and then adding complexity as the browser’s viewport gets larger. This has a couple of benefits:

  1. Mobile-first is a good way to design. These quotes nail the value in the approach:

    … we assume mobile users need less content in part because desktop users can tolerate more …

    … just because desktop users can sift through more content does that mean they need to? … why is easy access to key tasks only the domain of mobile users? Why can’t all users of our sites enjoy the same level of focused, curated content?

  2. Putting the more advanced CSS (and potentially bigger downloads) behind media queries with progressively higher min-widths means that devices that can’t use the advanced rules don’t have to be penalized by downloading things they can’t see.

A note on the electronic version: I now want to read all technical books on the iPad. The embedded videos that demonstrate how things adjust when you resize the browser window were invaluable. Not only is this better than a print version, it’s tons better than even a Kindle version.

After reading this, I feel much better equipped to determine when and how RWD should be used in my future projects. If you have anything to do with website creation (design, development, ownership), you owe it to yourself to read this book.

Software

If software isn’t solving your problem, and you can’t write it yourself or pay for its development, then software isn’t the solution.

I guess this is how a sports fan felt when Joe DiMaggio retired.
I suppose not reading is a bit like cutting off your thumbs: you’ll never be able to grasp anything.
If someone out there doesn’t hate your product, it’s probably not worth using.

putthison:

I interviewed Michael Rapaport about his amazing new documentary Beats, Rhymes & Life: The Travels of A Tribe Called Quest. I know there’s a lot of hip-hop heads following this blog, so do give it a listen. I’ll man up and admit: I cried while I was watching it.

Posts

March 01, 01:47 AM

Posted: 10:47pm
It's been fun, y'all. You can always find me at treypiepmeier.com.

[ 15 comments ]
February 28, 12:12 AM

Posted: 9:12pm
WhiskeRadnor

[ 4 comments ]
February 27, 02:22 AM

Posted: 11:22pm
Formal Friday-ish.

[ 1 comment ]
February 26, 12:24 AM

Posted: 9:24pm
Beard smash! Surprisingly hard to get his pose. I'll settle for this. @blastro forever!

[ 4 comments ]
February 24, 10:41 PM

Posted: 7:41pm
Today's purchase: iMac Today's theme: Behind the Beard

[ 13 comments ]
February 24, 01:27 AM

Posted: 10:27pm
Set up the Wii for the first time in months. Lots of system updates just to play some Mario.

[ 2 comments ]
February 22, 09:45 PM

Posted: 6:45pm
Michelle brought me Django buttons from PyCon!

[ 7 comments ]
February 21, 10:02 PM

Posted: 7:02pm
Sporting my Pho 79 shirt. Thanks, @Phil.

[ 3 comments ]
February 20, 06:44 PM

Posted: 3:44pm
I had a great time chatting with my personal Whiskerino hero @jnonfiction today.

[ 3 comments ]
February 16, 05:41 PM

Posted: 2:41pm
I put a ribbon on Maybelle's head. My sister Alison is doing very well after her brain surgery.

[ 8 comments ]
February 13, 11:39 PM

Posted: 8:39pm
Hangin' with the bro.

[ 7 comments ]
February 10, 08:07 PM

Posted: 5:07pm
I found a king at the library.

[ 20 comments ]
February 09, 11:53 PM

Posted: 8:53pm
Take it off.

[ 10 comments ]
February 08, 09:51 PM

Posted: 6:51pm
Hey, I got mentioned in a rap song. I guess I'd better keep going. I was seriously considering backing out. My perfect streak has been broken by 3 shameful days now. Rap song + it's my birthday = keep going (at least for now). I've been a bit disappointed that I'm not coming up with more creative stuff to share with the whisker-crowd. I'd rather do the minimum 1 photo a week and make that one count that just post mediocre junk every day. Can I blame it on not having a good camera? Nah, that's a lame excuse. Tone is in your fingers. It's just plain laziness and not taking the time and effort to do something remarkable. Maybe I can do better.

[ 14 comments ]
February 05, 12:18 AM

Posted: 9:18pm
I got yer stripes right here! Had a great time at the Geek Social tonight chatting with @bryanhunter.

[ 7 comments ]
February 03, 11:35 PM

Posted: 8:35pm
It's all I got right now.

[ 5 comments ]
February 02, 11:46 PM

Posted: 8:46pm
My current commute entertainment.

[ 11 comments ]
February 01, 09:51 PM

Posted: 6:51pm
Millions of peaches ...

[ 13 comments ]
February 01, 12:38 AM

Posted: 9:38pm
Icy whiskers.

[ 7 comments ]
January 31, 01:12 AM

Posted: 10:12pm
Cheers.

[ 10 comments ]
January 29, 05:29 PM

Posted: 2:29pm
Not really a Clamebute, but we'll just call this a tribute to @Jnonfiction. Also, do you dream of hedgehogs in top hats?

[ 10 comments ]
January 28, 10:54 PM

Posted: 7:54pm
You kids get off my yard! Tolleson-style.

[ 11 comments ]
January 28, 12:13 AM

Posted: 9:13pm
The Scratch!

[ 8 comments ]
January 26, 11:39 PM

Posted: 8:39pm
Bearded Enid.

[ 11 comments ]
January 25, 11:56 PM

Posted: 8:56pm
That's quite a value of alcohol per volume per dollar you can get from Trader Joe's. Also, I'm now a member of Team Sculptor. I'm no longer hardcore, but at least I still have a beard.

[ 17 comments ]
January 25, 12:06 AM

Posted: 9:06pm
Moebius collected stories from Marvel (Epic) in the 80s. I also have the ones Dark Horse put out in the 90s(?) which were undersized. Not as cool.

[ 5 comments ]
January 23, 09:37 PM

Posted: 6:37pm
Hold still.

[ 2 comments ]
January 22, 09:52 PM

Posted: 6:52pm
Can you see it, Joker? Feels to me... like it's written all over my face. I've lain awake nights... planning it... picturing it... ...endless nights... ...considering every possible method... treasuring each imaginary moment... From the beginning, I knew... ...that there's nothing wrong with you... ...that I can't fix... ...with my hands...

[ 9 comments ]
January 21, 09:29 PM

Posted: 6:29pm


[ 5 comments ]
January 21, 12:16 AM

Posted: 9:16pm
Always With Me Clockwise from lower left: Keys, wallet, Pilot G-2 0.38 pen (recommended by Gruber), grandfather's pocket knife, glass of PBR, hipster PDA.

[ 4 comments ]
January 19, 08:19 PM

Posted: 5:19pm


[ 3 comments ]
January 18, 10:25 PM

Posted: 7:25pm


[ 9 comments ]
January 18, 12:45 AM

Posted: 9:45pm


[ 8 comments ]
January 16, 06:41 PM

Posted: 3:41pm
Today I bought some new bags and boards for some of my old comics. This copy of Longshot #2 was one of the first comics I ever owned. 1985. I was eight. Longshot is a cool character because he looks like Joan Jett.

[ 11 comments ]
January 15, 10:53 PM

Posted: 7:53pm
Books I'm reading #5: Daredevil: Love and War. Just an old book I pulled out of my collection to read. A collection that will soon reside on comicbinder.com

[ 6 comments ]
January 14, 09:18 PM

Posted: 6:18pm
Books I'm reading #4: How to Win Friends & Influence People. It's an old book, but it's still really good. This copy belongs to my parents, and may have originally belonged to my grandparents. This edition was published in 1964, and it's the 114th(!) printing.

[ 11 comments ]
January 14, 01:53 AM

Posted: 10:53pm
Books I'm Reading #3: Mindfulness in Plain English. While I haven't yet taken up the habit of regular meditation, I realize the benefits of it. I found this book from a recommendation by Mister Hivelogic, Dan Benjamin. This is another book that I've had for quite a while, but still haven't managed to finish yet.

[ 4 comments ]
January 12, 09:31 PM

Posted: 6:31pm
I think I got this book last Christmas (2008). I still haven't finished it, but it's filled with some good things so far. I got the idea for my Solutions Log from this book.

[ 5 comments ]
January 11, 10:28 PM

Posted: 7:28pm
My theme this week: Books I'm Reading While I would normally consider myself a fairly large comic book dork (quite a bit more so when I was younger), it's the shameful truth that I've never read all of Watchmen. I don't even own this copy: I picked it up from the library today. And I even spend most of my free time working on a comic book collecting website. You can get some spoilers for the rest of the week on my Readernaut Reading list.

[ 19 comments ]
January 10, 09:14 PM

Posted: 6:14pm
Flannel Cobra!

[ 15 comments ]
January 09, 08:56 PM

Posted: 5:56pm
It was a great day to have a beard. Beautiful day at Radnor Lake, too.

[ 8 comments ]
January 08, 04:49 PM

Posted: 1:49pm
Half face day. @TheBandito's hat doesn't fit me.

[ 8 comments ]
January 07, 10:54 PM

Posted: 7:54pm


[ 6 comments ]
January 06, 10:00 PM

Posted: 7:00pm


[ 4 comments ]
January 05, 10:12 PM

Posted: 7:12pm


[ 8 comments ]
January 04, 11:20 PM

Posted: 8:20pm


[ 6 comments ]
January 03, 10:50 PM

Posted: 7:50pm
The Radnor Lake Whiskerino Pose™ Grandfather's binoculars on your eyes, glasses in your mouth, left hand extended with camera pointed towards your face.

[ 5 comments ]
January 02, 04:53 PM

Posted: 1:53pm
It's a sad day--Maybelle is going home. :(

[ 9 comments ]
January 01, 04:50 PM

Posted: 1:50pm
Walking with the fam on a cold New Years Day.

[ 6 comments ]
December 31, 10:43 PM

Posted: 7:43pm
NYE jammy party.

[ 0 comments ]
December 30, 10:15 PM

Posted: 7:15pm
Home made Fish Tacos! Yay.

[ 8 comments ]
December 29, 11:52 AM

Posted: 8:52am
Fishing on a Tuesday morning.

[ 7 comments ]
December 28, 11:02 PM

Posted: 8:02pm
Am I early?

[ 10 comments ]
December 27, 10:14 PM

Posted: 7:14pm
Back to the beginning.

[ 2 comments ]
December 26, 10:56 PM

Posted: 7:56pm


[ 9 comments ]
December 26, 02:17 AM

Posted: 11:17pm


[ 3 comments ]
December 24, 11:19 PM

Posted: 8:19pm
Beard status photo. It's still there.

[ 3 comments ]
December 23, 11:09 PM

Posted: 8:09pm


[ 6 comments ]
December 23, 12:33 AM

Posted: 9:33pm
Cheers.

[ 7 comments ]
December 21, 05:02 PM

Posted: 2:02pm
Hangin' with Djangles, the Django Gorilla. @Phil is a master Djangorillamaker.

[ 6 comments ]
December 20, 10:19 PM

Posted: 7:19pm


[ 2 comments ]
December 19, 10:09 PM

Posted: 7:09pm
Victor.

[ 12 comments ]
December 19, 12:34 AM

Posted: 9:34pm


[ 9 comments ]
December 18, 01:59 AM

Posted: 10:59pm
Christmas party mayhem.

[ 7 comments ]
December 16, 02:47 PM

Posted: 11:47am
Master Burrito Ambassador

[ 24 comments ]
December 15, 03:37 PM

Posted: 12:37pm
Double feature: Taco Tuesday + Profile Day

[ 11 comments ]
December 14, 09:02 PM

Posted: 6:02pm
The roof, the roof ...

[ 4 comments ]
December 13, 09:15 PM

Posted: 6:15pm
Y'ello.

[ 9 comments ]
December 12, 01:45 PM

Posted: 10:45am
Crashing the goose party.

[ 4 comments ]
December 11, 08:20 PM

Posted: 5:20pm
White on Both Sides.

[ 8 comments ]
December 10, 03:24 PM

Posted: 12:24pm
The sun came out today.

[ 7 comments ]
December 09, 02:12 PM

Posted: 11:12am


[ 6 comments ]
December 08, 01:32 PM

Posted: 10:32am
Fish Taco Tuesdays at Chile Burrito!

[ 14 comments ]
December 07, 09:09 PM

Posted: 6:09pm


[ 8 comments ]
December 06, 03:56 PM

Posted: 12:56pm
My buddy Max.

[ 12 comments ]
December 05, 05:27 PM

Posted: 2:27pm
Weekends means grilling. ALmost too cold today.

[ 8 comments ]
December 04, 05:01 PM

Posted: 2:01pm
Jumping with @TheBandito

[ 9 comments ]
December 03, 02:35 PM

Posted: 11:35am
Excited about what came in the mail today.

[ 17 comments ]
December 02, 09:36 PM

Posted: 6:36pm


[ 2 comments ]
December 01, 02:55 PM

Posted: 11:55am
Blurrytacos at the Chipotle. Take the camera off the picture of the little mountain, mmkay?

[ 9 comments ]
November 30, 05:09 PM

Posted: 2:09pm
The chest hair / beard barrier is arbitrary.

[ 6 comments ]
November 29, 05:30 PM

Posted: 2:30pm
Gotcha.

[ 3 comments ]
November 28, 02:51 PM

Posted: 11:51am
If you like it then you should've put a beard on it.

[ 5 comments ]
November 27, 05:19 PM

Posted: 2:19pm
Hanging out with my little niece.

[ 4 comments ]
November 26, 03:42 PM

Posted: 12:42pm
Hanging out with my little, bearded brother.

[ 8 comments ]
November 25, 06:59 PM

Posted: 3:59pm


[ 2 comments ]
November 24, 04:16 PM

Posted: 1:16pm
@thebandito is tiny.

[ 18 comments ]
November 23, 04:36 PM

Posted: 1:36pm
Doh.

[ 5 comments ]
November 22, 05:53 PM

Posted: 2:53pm
Rainy afternoon.

[ 8 comments ]
November 21, 10:36 AM

Posted: 7:36am
Saturday Mornings == Fishing.

[ 19 comments ]
November 20, 10:18 AM

Posted: 7:18am


[ 4 comments ]
November 19, 02:58 PM

Posted: 11:58am


[ 5 comments ]
November 18, 08:45 PM

Posted: 5:45pm


[ 7 comments ]
November 18, 12:08 AM

Posted: 9:08pm


[ 5 comments ]
November 16, 09:06 PM

Posted: 6:06pm
Getting fuzzy.

[ 4 comments ]
November 15, 07:05 PM

Posted: 4:05pm
It was beautiful at Radnor Lake today.

[ 5 comments ]
November 14, 06:32 PM

Posted: 3:32pm
Beard envy.

[ 7 comments ]
November 13, 05:43 PM

Posted: 2:43pm
The entire Marvel Universe.

[ 13 comments ]
November 12, 09:16 PM

Posted: 6:16pm
Something's cooking.

[ 7 comments ]
November 11, 09:09 PM

Posted: 6:09pm
The things I go through for a Chipotle burrito.

[ 10 comments ]
November 10, 03:35 PM

Posted: 12:35pm
What kind of animal is this cracker?

[ 13 comments ]
November 09, 10:39 AM

Posted: 7:39am
Good morning.

[ 7 comments ]
November 08, 07:15 PM

Posted: 4:15pm


[ 11 comments ]
November 07, 08:34 PM

Posted: 5:34pm
Waiting with Mom for my truck to get washed.

[ 8 comments ]
November 06, 03:57 PM

Posted: 12:57pm
Hello, Hillsboro Village. Long time no see.

[ 10 comments ]
November 05, 04:12 PM

Posted: 1:12pm
Getting a bit itchy.

[ 13 comments ]
November 04, 11:13 AM

Posted: 8:13am
Absorbing his powers again.

[ 14 comments ]
November 03, 02:45 PM

Posted: 11:45am
What t'hell is that guy looking at?

[ 10 comments ]
November 02, 03:36 PM

Posted: 12:36pm
Getting some literary inspiration.

[ 12 comments ]
November 01, 12:37 PM

Posted: 9:37am
It's always good to start with a little nudity. Let's do this.

[ 10 comments ]

Posts

October 14, 03:21 PM

I do not understand why this is was so difficult to figure out.

You’ll need Underscore.js to play along at home.

Start with an array like

1
var sizes = [4, 1, 10, 8];

If you just use JavaScript’s built in .sort() method, you’ll end up with

1
2
sizes.sort();
// results in [1, 10, 4, 8]

This is because it sorts lexicographically by default. Why? Because it (doesn’t) love you.

Here’s how to do it using Underscore’s sortBy method:

1
2
sizes = _.sortBy( sizes, function( val ){ return val; } );
// results in [1, 4, 8, 10]

Why does this work? I’m not sure. Ask your dad.

Source

April 28, 03:45 PM

Previously…

If you want to keep your templates in external files, you can load the template in like so:

1
2
3
$.get('/js/templates/filename.html', function(template) {
  $.tmpl(template, data).appendTo('#whatever');
});

A couple of benefits of this method:

  • Organizing your templates into their own files is tidy.
  • Your syntax highlighter will be happier, since you’re not writing HTML between two <script> tags.

Source

January 12, 03:07 PM

To keep from putting too many files and folders on your Desktop, make your icons huge.

  • Click on your desktop
  • From the menu, choose View > Show View Options

  • Crank up the size as far as it will go

  • Gaze at your huge, pretty icons and then get back to work

January 11, 05:09 PM
  • Create a folder in ~/Documents called TextMate Projects
  • Save your TextMate Project files there (not the projects themselves)
  • Change the icon of the folder to what the ~/Sites folder has (makes sense to me since I use TextMate almost entirely for websites)
  • Drag to the right side of your Dock
  • Right click the folder in the Dock
    • Display as Folder
    • View content as list

Voilà:

Note: you’ll see .tmproj at the end of the project name until the next time you restart your machine or you restart the Dock (killall Dock). Not sure what the deal is with that.

January 07, 11:25 AM

Sometimes you want to temporarily ignore a file in a Git repository without throwing it out entirely by putting it in .gitignore. Here’s how to do it:

git update-index –assume-unchanged [filename]

To start tracking changes again:

git update-index –no-assume-unchanged [filename]

Source

December 27, 01:30 PM

Django

mkdir -p ~/src
svn co http://code.djangoproject.com/svn/django/trunk/ ~/src/django
ln -s ~/src/django/django `python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"`/django
ln -s ~/src/django/django/bin/django-admin.py ~/bin/django-admin.py

PIP, mysql-python, virtualenv, virtualenvwrapper, Mercurial

Download and install the MySQL package installer, then:

easy_install pip
pip install http://downloads.sourceforge.net/project/mysql-python/mysql-python-test/1.2.3c1/MySQL-python-1.2.3c1.tar.gz?use_mirror=cdnetworks-us-2
pip install virtualenv
pip install virtualenvwrapper
pip install mercurial

(Note: we’re installing Mercurial because a lot of PIP packages require it)

In ~/bin/dotfiles/bash/env

export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
. ~/src/django/extras/django_bash_completion

Then

mkdir -p ~/.virtualenvs
source ~/.bashrc

Install libjpeg from scratch (for PIL):

cd ~/src
curl -O http://www.ijg.org/files/jpegsrc.v8a.tar.gz
tar zxvf jpegsrc.v8a.tar.gz
cd jpeg-8a
./configure
make
make install

Setup a project

cd [path/to/your/project/]
mkvirtualenv [projectname]
add2virtualenv .
echo ‘cd [path/to/your/project/]’ >> $WORKON_HOME/postactivate

Put requirements for your project into a requirements.txt like so:

A package on its own line:

docutils==0.6

Repo noted like so:

-e git://github.com/mintchaos/typogrify.git#egg=Typogrify

To install things in your requirements file

pip install -r requirements.txt

Starting and Stopping VirtualEnvs

Start:

workon [project]

Stop:

deactivate

Sources

November 13, 06:06 PM
1
2
3
4
5
6
7
$('.button').click(function(e) {
    if (e.originalEvent) {
        // user click
    } else {
        // .click()
    };
});

Source

November 03, 12:49 PM
Set it up
1
2
3
4
5
6
7
8
9
10
adjustDisplay: function(smooth){
    if (smooth === undefined) { smooth = false };
    
    if (smooth) {
        $('#content').animate({height: '500px'}, 200);
    } else {
        $('#content').css('height', '500px');
    };
},

Call it
1
app.adjustDisplay('smooth');
October 25, 12:22 PM

Create a Template (most basic way):

1
2
3
<script id="book-template" type="text/x-jquery-tmpl">
    <li>${name} (${year})</li>
</script>

Note that the type attribute is set to text/x-jquery-tmpl (text/html would do the trick as well). Anything other than text/javascript is ignored by the browser. Also, leaving it out entirely will default to text/javascript (thank you, HTML5 for making it OK to do that).

Data:

1
2
3
4
5
6
7
8
9
10
var books = [
    { name: 'The Gunslinger',               year: '1982' },
    { name: 'The Drawing of the Three',     year: '1987' },
    { name: 'The Waste Lands',              year: '1991' },
    { name: 'Wizard and Glass',             year: '1997' },
    { name: 'The Wolves of the Calla',      year: '2003' },
    { name: 'Song of Susannah',             year: '2004' },
    { name: 'The Dark Tower',               year: '2004' },
    { name: 'The Wind Through the Keyhole', year: '2012' }
];

Load the template with data:

1
$('#book-template').tmpl(books).appendTo('#book-list');

To be totally explicit: the first selector is the ID of the template (script tag), the argument being passed to .tmpl is the array, and then we’re appending the whole thing to the #tower-list object in the DOM.

Now don’t forget some HTML:

1
<ul id="book-list"></ul>

Source

August 22, 03:00 PM

Install django-css.

Install Sass.

sudo gem install haml

Add to settings.py:

settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
INSTALLED_APPS = (
  
  'compressor',
  
)



COMPILER_FORMATS = {
    '.sass': {
        'binary_path':'sass',
        'arguments': '*.sass *.css'
    },
    '.scss': {
        'binary_path':'sass',
        'arguments': '*.scss *.css'
    }
}

Add to a template that you want to load a Sass file:

1
2
3
4
5
6
7
{ % load compress % }



{ % compress css % }
<link rel="stylesheet" href="css/base.scss" media="screen">
{ % endcompress % }

Dealssss with caching when you deploy.

Perhaps pip install python-memcached then put something like this in settings.py

1
CACHE_BACKEND = 'memcached://127.0.0.1:11211/'

Write some nice Sass.

Your snazzy Sass file
1
2
3
4
5
6
7
8
$orange: #EE8529;

ul {
  font-size: 26px;
  li {
      color: $orange;
  }
}
June 09, 04:43 PM
1
2
3
4
5
6
7
8
9
var Fancy = {
  settings: {
      something: 'one',
      somethingElse: 'two'
  },
  init: function(options){
      var s = $.extend({}, this.settings, options);
  }
}

Call it like so:

1
Fancy.init({something: 'Luke', somethingElse: 'Wroblewski'});

That’s one way to do it anyway.

June 09, 04:36 PM
function makeItRain (effect) {
    $(‘#something’)[effect]();
}

makeItRain(‘slideToggle’);

Note the lack of a ’.’ and the ’[]’s.

Source

February 28, 01:42 PM

If you already have a /usr/local folder and it’s not owned by your user:

sudo chown -R `whoami` /usr/local

Install Homebrew:

cd /usr/local
git init
git remote add origin git://github.com/mxcl/homebrew.git
git pull origin master

This is kind of odd–you install Homebrew right into the base of your /usr/local folder. It nicely ignores other folders that already exists there. Just do it.

Install MySQL:

brew install mysql

Yeah, it’s really that easy. This will take a while.

Now warm it up:

mysql_install_db

And make sure it automatically starts again on login:

launchctl load -w /usr/local/Cellar/mysql/5.1.43/com.mysql.mysqld.plist
February 25, 02:56 PM

I keep having to look this up.

To add the mate shell command, select the Help menu from within TextMate and select "Terminal Usage…"

Source

February 22, 05:02 PM

First, create a Git subfolder inside your Dropbox folder. Then you can share the individual projects inside that folder with whomever you want (or just use it for instant offsite backups).

From inside a Git project:

git clone –bare . ~/Dropbox/Git/gitproject.git
git remote add dropbox ~/Dropbox/Git/gitproject.git

When you’re ready to push:

git push dropbox master

Your Collaborator’s View

Your collaborator would work on the project like so (inside the folder where they want their project to live):

git clone ~/Dropbox/Git/gitproject.git

If they want to have a dropbox remote instead of the default origin:

git remote add dropbox ~/Dropbox/Git/gitproject.git

They would then push the same way:

git push dropbox master

To get the other person’s changes, it’s the standard deal:

git pull dropbox master

Source

January 10, 04:46 AM
sudo easy_install Sphinx

Inside your local SVN checkout of Django:

cd docs
make html

Now you’ll have a beautiful local copy of the documentation to browse for those rare moments when you’re away from the internet (perhaps you’re in a fort?). Just point your browser to:

file:///path/to/your/django/docs/_build/html/index.html

Source

January 04, 10:03 PM

Previously…

  • Install the latest Xcode Tools from your Snow Leopard installation DVD
  • Re symlink things to /Library/Python/2.6/site-packages (Leopard used 2.5)
    • Django
    • Any other thing you had symlink’d in 2.5

MySQL + Python

After all that Sequel Pro is still showing the version of MySQL as 5.1.33, but it seems to be working…

PIL

This was by far the biggest headache. I finally found a solution:

Install like this, but before running sudo python setup.py install, do this:

LDFLAGS="-arch ppc -arch i386 -arch x86_64" CFLAGS="-arch ppc -arch i386 -arch x86_64" python setup.py build

If you already had PIL installed and had the source files you compiled from before, be sure to delete them and start fresh from a new Imaging-1.1.6.tar.gz.

December 10, 06:08 PM

Here’s another look into the development of ComicBinder.

There’s already a good tutorial on how to use an autocomplete plugin with Django, but I wanted to use this much snazzier plugin.

The Process

Load both jquery.autocomplete.min.js and jquery.autocomplete.css in your page.

In your form object, create a CharField to hold your autocomplete. Something like:

1
title = forms.CharField(label='', widget=forms.TextInput(attrs={'placeholder': 'The name of a comic'}))

Create a hidden field to hold the primary key of the item you’re selecting (so you don’t have to depend on searching against a ‘name’ field or something else equally brittle):

1
title_pk = forms.IntegerField(widget=forms.HiddenInput())

Create a view to populate the autocomplete list:

1
2
3
4
5
6
7
8
9
10
11
def title_lookup(request):
    results = []
    if request.method == "GET":
        if request.GET.has_key(u'q'):
            value = request.GET[u'q']
            # Ignore queries shorter than length 3
            if len(value) > 2:
                model_results = Title.objects.filter(name__icontains=value)
                results = [ (x.__unicode__(), x.id) for x in model_results ]
    json = simplejson.dumps(results)
    return HttpResponse(json, mimetype='application/json')

This will, of course, need a URLconf:

1
url(r'^title_lookup/$', view=title_lookup, name='title_lookup'),

And to finish it off, a bit of JavaScript in your template to call the plugin:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<script>
    $(function() {
        $('#id_title').autocomplete('{ % url title_lookup % }', {
            dataType: 'json',
            width: 500,
            parse: function(data) {
                return $.map(data, function(row) {
                    return { data:row, value:row[1], result:row[0] };
                });
            }
            }).result(
                function(e, data, value) {
                    $("#id_title_pk").val(value);
                }
            );
        }
    );
</script>

Sources

December 02, 06:50 PM

While building ComicBinder’s URLs, I wanted a way to differentiate a volume of a title other than one, and a printing of an issue other than one. So, for example, a URL to the second printing of the second volume of Amazing Spider-Man #1 would look like:

/marvel/amazing-spider-man_2/1_2/

That’s easy enough with some URLconf wrangling. What I’m talking about today is automatically redirecting a request for _1 in any of those places to the same URL without the _1. While technically correct, I want the lack of underscore + number to mean one, and for there to be only one URL for a resource (someone send me a link to a clever article that talks about this).

django.views.generic.simple.redirect_to to the rescue. Try something like this:

(r’^(?P<publisher>[-\w]+)/(?P<title>[-\w]+)_1/(?P<number>\d+)_1/$’, ‘django.views.generic.simple.redirect_to’, {‘url’: ‘/%(publisher)s/%(title)s/%(number)s/’}),

I made a few of these to account for situations where it was the first volume, but nothing specified for printing, and vise versa.

Not too bulky, and since I have that sitting near the normal rule, it shouldn’t put me out too much to update it if I make any changes.

Source

November 09, 05:55 PM

With The Django Debug Toolbar

Somewhere in your Python code (not a template):

import logging
logging.debug(something_you_want_to_log)

With Firebug

Somewhere in your JavaScript or the Firebug Console:

console.log(something_you_want_to_log);

That was easy.

Sources

Posts

May 06, 10:45 AM


APOD: 2010 May 6 - Northern and Southern Owls

A look at the fate of our sun. 2 light years is a big area. 2,000 times the size of the diameter of the orbit of Neptune.

November 06, 09:53 AM


APOD: 2009 November 6 - Ring Nebula Deep Field

It’s odd that something so utterly gruesome could be this pretty. It’s like driving by the rotting corpse of your neighbor’s father on the side of the road. This is the fate of our sun in another 5 billion years or so.

June 09, 07:05 AM


APOD: 2009 June 8 - Possible Jet Blown Shells Near Microquasar Cygnus X1

This is an annotated picture of a black hole with all sorts of interesting stuff happening around it.

April 14, 09:41 AM


APOD: 2009 April 11 - The Big Picture

As I’ve said before, it’s hard to place in context the amazing pictures you see of deep space with the sky you see every night. This helps.

February 14, 02:02 PM


APOD: 2009 February 9 - Anemic Galaxy NGC 4921 at the Edge

It’s cool to see three very distinct regions of space in a single picture. The focus of the picture is the large galaxy, but you can also see “nearby” stars in our own Milky Way as well as even more distant galaxies behind the big one in the picture.

November 23, 03:29 AM


APOD: 2002 January 21 - Volcano and Aurora in Iceland

I can’t imagine what it must be like to live somewhere where you can see things like this.

November 15, 10:24 AM


APOD: 2008 November 14 - Fomalhaut b

Since I got interested in astronomy as an impressionable young man, I’ve understood that most stars probably have planets around them. It’s been really rewarding to watch the progress over the last few years as more and more planets have actually been observed (for the most part indirectly—until now). I even understood that to directly observe a planet around another star, the exact technique used in his photograph would have to be used.

This planet is 3 times the size of Jupiter and 14 times farther away than Jupiter is from our sun. It’s also a mere 25 light years away (basically in our cosmic backyard). That means it is an enormous (probably uninhabitable) planet really far away from its star, which is very close to us. So it’s probably about as easy to visually observe as any planet in our immediate neighborhood. It’s an incredibly important step in the exploration of our galaxy, but there’s still a ways to go.

It’s amazing that so much has happened in this field in such a short time. I would not be surprised if within the next decade or so we observe a planet that is a potential target for an interplanetary mission.

It’s an exciting time to be alive.

October 20, 01:51 AM


APOD: 2008 October 17 - An Extraordinary Voyage

Apparently dumping trash into the atmosphere and taking video of it is APOD worthy. Who knew?

October 01, 11:46 PM


APOD: 2008 September 29 - A True Image from False Kiva

This one’s been making the rounds on Tumblr, so I thought I should make a place for it on the APOD Log. This is an amazing picture.

bauldoff:


No PhotoShop here. Astrophotographer Wally Pacholka took this single exposure photograph at False Kiva in the Canyonlands National Park, Utah. He admits to being concerned about mountain lions as he waited in the dark cave to capture this beautiful view reaching from inside the Earth to infinity. (via Neatorama)
September 19, 10:25 AM


APOD: 2008 September 19 - Companion of a Young Sun like Star

This is big news. An actual photograph of a planet in another solar system. Within the last few years, they’ve found scads of planets around other solar systems, but I’ve never heard of there being a direct photograph.

From APOD:

this picture likely represents the first direct image of a planet belonging to a star similar to the Sun.

Does that mean there have been other direct images of planets around non sun-like stars?

In any case, this is incredibly cool.

Previously

July 28, 10:22 AM


APOD: 2008 July 28 - SDSSJ1430: A Galaxy Einstein Ring

This is some crazy, relativistic stuff right here—gravity bending light into a circle. The computer generated images of the individual parts are especially cool.

July 23, 11:22 AM


APOD: 2008 July 23 - High Cliffs Surrounding Echus Chasma on Mars

This is the kind of APOD I like: nobody really knows what’s going on here. This one is also great because I was sure it was an illustration. Nope—it’s a photo from the Mars Express orbiter. It really looks like an illustration in a science book from the 50s or 60s.

July 15, 03:31 PM


APOD: 2008 July 15 - Gas and Dust of the Lagoon Nebula

Pictures like this where they remove the stars are really striking. If most of what was removed was foreground stars, I suppose this gives a more realistic view of what it would be like to be closer.

See also.

July 14, 10:54 AM


APOD: 2008 July 14 - Changes in Angular Mars

I had never thought of this—since Mars is further from the sun than we are, we never see Mars (or any other planet further out than we are) in a crescent phase.

Videos

abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz