Trey Piepmeier
Posts
Meaningful uncertainty is often a crucial component of real choice.
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.
Two of my heros.
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.
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).
- 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.4583333333333333that you put in your CSS (hopefully with a comment next to it showing how the number was derived.)
- Flexible Images
- This stuff just seems magical. I especially love the technique of clipping images in certain circumstances.
- 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:
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?
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.
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 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.
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
Posted: 10:47pm
It's been fun, y'all. You can always find me at treypiepmeier.com.
[ 15 comments ]
Posted: 9:24pm
Beard smash! Surprisingly hard to get his pose. I'll settle for this. @blastro forever!
[ 4 comments ]
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 ]
Posted: 7:54pm
You kids get off my yard! Tolleson-style.
[ 11 comments ]
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 ]
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 ]
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 ]
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 ]
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 ]
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 ]
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 ]
Posted: 2:02pm
Hangin' with Djangles, the Django Gorilla. @Phil is a master Djangorillamaker.
[ 6 comments ]
Posted: 11:35am
Excited about what came in the mail today.
[ 17 comments ]
Posts
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
| |
If you just use JavaScript’s built in .sort() method, you’ll end up with
1 2 | |
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 | |
Why does this work? I’m not sure. Ask your dad.
Source
If you want to keep your templates in external files, you can load the template in like so:
1 2 3 | |
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
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
- Create a folder in
~/DocumentscalledTextMate Projects - Save your TextMate Project files there (not the projects themselves)
- Change the icon of the folder to what the
~/Sitesfolder 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.
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
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)
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
1 2 3 4 5 6 7 | |
Source
1 2 3 4 5 6 7 8 9 10 | |
1
| |
Create a Template (most basic way):
1 2 3 | |
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 | |
Load the template with data:
1
| |
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
| |
Source
Install django-css.
Install Sass.
sudo gem install haml
Add to settings.py:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | |
Add to a template that you want to load a Sass file:
1 2 3 4 5 6 7 | |
Dealssss with caching when you deploy.
Perhaps pip install python-memcached then put something like this in
settings.py
1
| |
Write some nice Sass.
Your snazzy Sass file1 2 3 4 5 6 7 8 | |
1 2 3 4 5 6 7 8 9 | |
Call it like so:
1
| |
That’s one way to do it anyway.
function makeItRain (effect) {
$(‘#something’)[effect]();
}
makeItRain(‘slideToggle’);
Note the lack of a ’.’ and the ’[]’s.
Source
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
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
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
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
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
- Install MySQL from source like Dan says but use the latest version of MySQL (5.1.42 in my case) instead of the version he says to use.
- Install MySQL-Python like the top answer on this Stack Overflow question.
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.
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
| |
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
| |
Create a view to populate the autocomplete list:
1 2 3 4 5 6 7 8 9 10 11 | |
This will, of course, need a URLconf:
1
| |
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 | |
Sources
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
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
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.
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.
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.
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.
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.
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.
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.
APOD: 2008 October 17 - An Extraordinary Voyage
Apparently dumping trash into the atmosphere and taking video of it is APOD worthy. Who knew?
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.
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)
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.
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.
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.
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.
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.
