girasquid.com

tags categories

Personal website of Luke Hutscal.

Taking Stock

Sunday, April 5th 2009

musing

0 comments

One of the interesting things about being someone who works with the web is that, for all that we make up a small amount of society, we make up a sizable majority of the content creators on the internet.

Blogs, Twitter, feeds – they’re all us. Others use them, but we use them more.

In the interests of seeing just how much content I create, I’ve tallied up my blogs and accounts. Here’s where I stand:

  • 3 google accounts
  • 3 Tumblr blogs
  • 6 Twitter accounts
  • 5 Blogger blogs
  • 2 self-hosted Wordpress blogs
  • 1 custom blog
  • 1 ‘corporate’ blog

Looking at the last year or so alone, I write about 3 different blogs – one about programming and tutorials, one for my employer, and this personal blog. I’ve also recently started up another, secret blog – the purpose of which is also secret. One of my blogs has even gotten into 9rules – although whether that’s as hard as it used to be is something I’ve often wondered.

I think that the ‘typical user’ has a blog. Maybe a Twitter account.

But probably not five of each. Who knows how many I’ll have in a year or two?


Filtering <select>s with jQuery

Tuesday, December 23rd 2008

filter, jquery

javascript

0 comments

What happens when you have a <select> that has options you don't want included in it, but you only want one of those options to be available to the user? In most cases, you're left either asking the original developer to change the way their code works(not always an option), or writing a hack that will filter the select for you. jQuery makes filtering <select>s pretty easy:

1
$("#id_select option:not([text*='workshop'])").remove();

That snippet will remove all <option> elements that have a text value other than 'workshop' – which was exactly what I needed for the project I was working on.


Easy Random Passwords

Thursday, December 11th 2008

generated, passwords, random, snippet

python

0 comments

As most of the people who have worked on anything involving an authentication system with me know, I’m a little bit paranoid when it comes to security and passwords. It makes me nervous not having unique and long passwords for each situation in which you might need one.

With that in mind, coming up with sufficiently arbitrary passwords has been a bit of a problem – and so I’ve turned to generators. For a long while, http://strongpasswordgenerator.com served my needs perfectly – I’d uncheck the ‘symbols in password’, and set the length to 21 characters – generating a nice, usable strong password, that I could double-click to select(which is why I don’t put symbols into passwords). However, I only ever use the site with those two options; there’s never any variation in what I need(or want) from the site. With that in mind, I wrote myself a script:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#!/usr/bin/python

import subprocess
import random

from string import ascii_letters,digits

password = ''.join([random.choice(ascii_letters + digits)) for i in range(21)])
p = subprocess.Popen(['pbcopy'],stdin = subprocess.PIPE)
p.stdin.write(password)
p.stdin.close()

If you’re running on OS X, that script will build you a 21 character long password, every time – using all 62 characters available to it(upper and lowercase alphabet + numbers). It will also copy the password into your clipboard – which means you run it, paste it where you need it, and forget about it.

If you’re not on OS X, you may need to modify the parts of the script that actually put the password into your clipboard; as far as I’m aware, neither linux nor windows have a ‘pbcopy’ command.


The code you never expect to write.

Tuesday, December 9th 2008

django

0 comments

This was a piece of code for a small side-project I’ve been working on:

1
2
3
4
5
@login_required
@dust_bunnies
def fridge(request):
    # combat!
    pass

My best typo to date

Monday, December 8th 2008

typo

typos

0 comments

I frequently use my iPhone to draft up posts, and a few days ago I made perhaps my worst typo ever:

It don’t mean a hong if it ain’t got that swing.

‘Nuff said.