I've been doing some crochet
December 16, 2014, 2:04 pm

Apparently, it's weird when a man does anything crafty. I don't cotton to that line of thought. I really like crochet over knitting, because it is fairly mindless. I can single stitch crochet all night long, and pretty much not have to think for hours. It's great to throw on a comfort show, and just lose yourself.

I was never very good at knitting, however. I find myself poor at judging and maintaining tension, and I honestly find purling to be annoying. I am currently at the crafting stage where I have a number of needles and hooks, but I am not willing to dive into a project yet if it's possibly going to take more than a week of a few hours a night to complete.

But I love making scarfs. I love wearing scarfs, so being able to make them is pretty cool. I enjoy trying out different stitch patterns and sizes and colors of yarn. Honestly, I think anyone can learn to crochet, and I believe everyone should.

Santa Con 2014
December 9, 2014, 3:04 pm

This weekend will be Santa Con in San Francisco. Thousands of folks dressed up in holiday attire will descend upon downtown and join in a bit of festive merry making. Men will be dressed as Santas, and ladies will be dressed as sexy Santas, and probably some guy will be naked Santa, and also there will probably be a racist Santa, and I'm sure some lady will be a sexy elf, and a sexy reindeer, and a sexy present, and a sexy christmas tree. It's basically just like Halloween, except christmas themed and aimed at adults. The point is, there will be an equal opportunity for all kinds of Santas to show up and have fun.

And then they will disperse. They will head north like a flock of birds, but instead of searching out warmer climates, they will seek drunker locales. For many the drinking never stopped.

I have participated in three Santa Cons now, and it is a blast every time. But I don't think I've ever made it past the Condor. Apparently there are rousing good parties all up and down North Beach, but I've never seen them. Maybe this time, I will finally see what lies beyond the open windows of the little bar by day, strip club by night, but for me, it's the place in the middle to hole up and have fun.

An hour of code
December 9, 2014, 12:38 am

This week is Hour of Code week. It's a national event to try to get kids interested in programming. I'm a big proponent of everyone knowing at least a little about how to program. I think it all seems so scary, because most people don't have a simple enough place to start.

I am doing a presentation at the Apple Store in downtown San Francisco this Thursday, December 11th. It is going to show you how you can make a simple image gallery with a little bit of html, css, and javascript. This is for absolute beginners to get an idea of what is possible with a relatively small amount of code. If you want to get a head start, the code I'll be making can be found here. I'll be talking about the programs I use, and how getting started is the biggest hurdle.

I personally think everyone should have their own website. Not everyone has to put in my level of effort, but to be fair, I've put in nearly 20 years of effort, and now you can just reap the benefits of my experience. But I definitely think everyone should have more than an auto generated webpage that's just created by wordpress or wix. Make a little code and create something.

If you're interested in web tutoring, in San Francisco, I would love to help you get up and running, so hit me with an email.

Here is a list of important links for this presentation.

I taught javascript all day
December 6, 2014, 1:25 am

I tutored a student today for 5 hours about javascript. It was intense. When you're a teacher of code, you run a thin line between getting good code into your students' hands, and actually having them understand what the heck you just gave to them. When it comes to Javascript there is a LOT of stuff you can do to be cute and ridiculous, and it just makes NO sense when you try to explain it.

Let me give you an example.

;(function(w){})(window);

The weirdest part about this isn't even the closure. The closure is fascinating, but the more stupid part is that first semicolon. How do you explain that to someone? Well, you see, child, some people's code is absolute shit, and someone might take your code and try to compile it with other code, and if the other code is bad, it will break your code, so you should just put in a little insurance to break their code before their code breaks your code.

It's so dumb. I love it. I love the dumbness of Javascript so much.

To the girl with the drawable hair
December 4, 2014, 8:37 pm

Hi. I totally ran up on you in the BART, and gave you my card. Did you like the drawing? I made some comment about you getting drawn again. It was a genuine offer. If you ever want to get drawn again, please email me. I only had about 10 minutes this time, it wasn't enough.

I draw people on the BART in San Francisco all the time. Although, this is actually the first time I've asked anyone if they wanted to be drawn for reals.

The deeper I get, the dumber I feel
December 4, 2014, 1:35 pm

It's pretty hard to stop learning if you're at all interested in a subject. But goddamn, if programming isn't an endless hole of more and more stuff to learn.

Here's something I've realized about new programmers. They all want to try to trick themselves by shortening variable names. Don't this, kids. Make your variables as descriptive as possible. You get dumber and dumber as you learn more and more, and it becomes impossible to remember or even care what all your shortened variable names meant. Just say what you mean, and don't try to be cute.

What's the point of Git?
December 2, 2014, 3:31 pm

Github is not the be all end all of Git. Git without the hub is totally possible, and honestly something that I can't believe isn't being taught to everyone.

So let's get started.

Git without the Hub

Git requires one thing; Git. Git is the language of version control. What is version control? Version control is your way of keeping track of previous states of your various projects. It's like saving, except it's more like snapshots. A snapshot of an entire project. Images, videos, vector files, scripts, documents? All can be controlled by git to be able to roll back to a previous state if necessary.

What's great is you don't need anything other than a terminal to work it. Now if you're on Windows you might be saying "I don't have a terminal". That's right, but you're also on a bad system for development. Windows might be great for graphics, but *NIX systems will always be the place to do dev work. Luckily when you install Git, it will probably give you an application called git-bash. This program will emulate a unix terminal, and all of its commands. So whenever I say open a terminal, I'm telling you Windows users to open up git-bash.

git init

Here's the easy part. Open a terminal. cd to your project directory. Everything you want to track will need to go in one main folder.

~/ $ cd ~/Development/Project/

You might as well ls your files to make sure you're in the right folder.

Project/ $ ls

Great, now that we know how to move around in the terminal, let's go ahead and initialize our folder for git.

Project/ $ git init

If you ls again, you won't notice anything special, but if you ls -a you should now notice a hidden folder showing up called .git. That's where all the magic happens. And when I call it magic, you should know well enough to leave it alone, and allow yourself to be bewildered, because ain't no excuse I can up with to want to dive into that mess of a folder. Suffice to say, thar be magic, and that's where it happens.

git add

So now that we have a sweet .git folder we can actually add some files for tracking. If you're daring, and your project isn't already too very large, you can try out a git status to see how many files are currently untracked. By the way, Git's messages are usually very helpful as to what's going on, so don't just shuffle by them.

Alrighty. Now that you know you have untracked files. Let's add them to the tracking system. You can add each individually, git add file.html, but I actually just got a hernia thinking about that, so an easier way is to just add them all at once.

Project/ $ git add .

That will add every single file recursively into your project as a tracked item. Awesome! If you git status again (do it a lot) you will see that there are now a bunch of green files ready for commitment.

Get over your fear of commitment

Commit often. That's the motto. Commiting with Git is like taking a snapshot of the project. Every time you want to save, go ahead and commit. But hold on there, sparky. Every committal must have a message telling the system, you, and any other team members, why this commitment took place. This step seems unnecessary to first-timers, but trust me, it's your first line defense against the stupidity of you. Be descriptive, and tell yourself the reason for saving at this moment. "I fixed the code". "I added corn chips". "I hate greys".

Project/ $ git commit -m "Initial commit"

The next commitment

After you've added all your files, you don't need to keep adding them. You can just commit with an -a flag. This will update any currently edited files that were previously added to the Git tracker.

Project/ $ git commit -a -m "Updated files"

If however you actually do add any new files, those will need to be specifically added, or inductively added with another git add . command. If you would like to remove files from tracking (perhaps because you deleted them) you can simply git rm file.txt to remove them from tracking.

This was a quick introduction to Git without the Hub. I will do another one of these soon all about stepping back through commits, and also another about branching.

It's not how you lie to trick someone
December 2, 2014, 10:32 am

Now I'm not saying third rock from the sun was for everyone, but it came along at a perfect time in society, when it was still kind of ok to pull comedy from horrible situations. I almost feel like a gag like this put in a show today would get pulled for some ridiculous reason, even though it's clearly one of the funniest things EVER. It's so incredibly shocking to see the situation get ratcheted up so quickly, and it shouldn't matter who hit who, it should be about the comedy.

Here, I'll show you the exact same gag, but with dudes.

See? Still funny.

This post has nothing to do with programming.

A little bit here, a little bit there
December 1, 2014, 11:22 am

Fixed the thumbnail generator last night. Dumped all the old thumbnails. Over 400. Seems like a lot. Don't think I even have that many images.

Really happy to be able to blog regularly again. I enjoy writing down my thoughts, and even though this is a spot that I show my students, I feel comfortable writing whatever I want here. Most of my blogging is about code anyways.

I continue to improve my base sass files. If you're interested in those files, they are properly underscored, eg. _base2_classes.scss. I have moved them into a condensed css output now, which should help the download of this site even further. I continue to work on SEO and optimization. It's a job that's never really done. Now that my main site is feeling better, I feel confident I can move forward with a redesign soon. I continue to pull in code from side projects. Smallcode was a little thing I put together to show off tiny bits of javascript, but also just common javascript functions that I need all the time. I also used some php code in there for converting block formatted elements into ordered lists for displaying code. If I get that working with my editor, I'll share it out here.

My blogeditor now has a preview as I type. It is a very zen feeling to type on the left, but look to the right. Always look forward in everything you do. Never be satisfied to pine for the past.

...

My preview is one letter behind my typing. I wonder if I should fix that...

Nevermind, I fixed it. It's the difference between keypress, and keyup. onkeypress hasn't written the current letter to the input value yet. onkeyup has.

More work gets done
November 30, 2014, 2:03 pm

Slowly, slowly, I'm improving my code. I'm corralling all the random bits of code from all my different projects, and bringing them into one place. I'm fixing a lot of the bad things, and moving forward. I've dropped AngularJS from my main page, and switched to straight php. I never liked how the posts would take a second to load in, and now the site seems to blaze forward a lot better.

I've started hanging out at coffee shops a lot more. Doing code at home is hard to keep up for pace. I have to go out and get myself into an environment where it doesn't feel so comfortable.

Did karaoke last night for the first time in forever at a little bar in Japantown and it was really awesome. Everyone was into it, and it was nice to go to a bar where you had a chance to sing, but you also weren't sequestered in a booth. I was rusty as all hell, but it didn't matter. It felt good to be back. I think I'll go again.

I also added a number of new places over on the sidebar for my stuff, including Twitter and Github. Improved the icons and placement as well. I also pushed up the quality of thumbnails, but I don't know if I'd have to dump them all to get them all to recreate... I should probably know that.