Max Glenister

2011

15 posts

December

October

  • Trying coffeescript

    Recently decided to give coffeescript a go, it’s nice and syntactically similar to other languages such as Python. From the coffeescript developers: CoffeeScript is a little language that compiles into JavaScript. Underneath all of those embarrassing braces and semicolons, JavaScript has always had a gorgeous object model at its heart. CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way. Here’s my first test with it, first of all a golfjs solution I wrote, using obfuscated (read: in as few bytes as possible) JavaScript: i=input,v=i.match(/[aeiou]/gi),y=i.match(/y/gi), output=(v?v.length:0)+(y?y.length/2:0) And here’s the same code in coffeescript: v = /[AEIOU]{1}/gi y = /Y{1}/gi a = if input.match(vow) then input.match(vow).length else 0 b = if input.match(y) then input.match(y).length*0.5 else 0 output = a+b And the JavaScript coffeescript compiles to: var a, b, output, v, y; v = /[AEIOU]{1}/gi; y = /Y{1}/gi; a = input.match(vow) ? input.match(vow).length : 0; b = input.match(y) ? input.match(y).length * 0.5 : 0; output = a + b;

    • 1 min read

August

  • Notched - indicate if Notch has replied to a topic on /r/minecraft comments

    Another Chrome userscript for reddit.com This one is specifically for anybody wanting to know if Notch (the creator of Minecraft) has responded to the comment thread they are reading. Unable to recover the image :( This script adds a div to the top of the comments thread saying if Notch has replied, and then has a link to each comment. Grab it here: http://userscripts.org/scripts/show/110751

    • 1 min read

July

  • Imgur Url Changer and pics/funny comment link subreddit remover aka reddit link stuff

    I know, it sure is a catchy name! This is just a modification of my previous “Imgur to Filmot url changer” userscript for reddit.com

    • 1 min read
  • Google Plus userstyle for Reddit

    I created a userstyle for Reddit to make it look more like Google+ and other redesigned Google sites. To install you will need either Stylish or Stylebot for Google Chrome. I’ve only tested this in Google Chrome, and it’s far from complete, but for now it functions nicely enough on subreddit pages and comment threads. For the best experience, disable custom styles for subreddits.

    • 1 min read
  • Reddit open imgur links in new window/tab

    Derivative of the previous reddit/imgur userscript I wrote, this one simply makes all imgur links open in new window/tab (target="_blank") Download

    • 1 min read

June

  • Reddit imgur to filmot url changer

    Browsing Reddit while at work probably isn’t the best thing to do if trying to be productive, but sometimes it’s necessary to unwind periodically. Inside our intranet at work imgur is blocked, so browsing Reddit isn’t as enjoyable as it could be.. until now!

    • 1 min read

March

  • My solution to the JavaScript challenge 07/03/11

    Okay so this solution is a bit later than I planned, but a busy working week and lack of motivation toward the end kind of got the better of me. Anyway, here’s my solution to the challenge. I’m sure Tomas will post his up soon.

    • 3 min read
  • Javascript function to group repeated values of an array with totals

    Something that took a little while to pull of well while working on the JS challenge this week, thought I’d throw it up here as it has its uses practically for grouping like array values with totals:

    • 1 min read
  • Javascript/jQuery challenge of the week 07/03/11

    Okay well this is something Tomas and I have been planning to do for ages, and in fact we did something like this a year ago, but it didn’t amount to a lot.

    • 3 min read
  • Building JavaScript arrays from HTML using regular expressions

    Bit of idea ping-pong with Tomas this evening, to provide a solution to something he is working on. He had some text in a table cell that needed to be split and put into an array, separating each line into two parts.

    • 1 min read

February

  • Review: The Smashing Book #2

    The Smashing Book #2 is a book about web design and development from the folks over at smashingmagazine.com. As the name implies, it’s their second Smashing Book. When the first Smashing Book was released in 2009, I jumped to the chance of buying a copy. I’ve always been a fan of Smashing Magazine, and figured Smashing Magazine in print form couldn’t be a bad thing (and it would be a nice book for reading on my bus commute to/from work each day). The first book talked a lot about coding best practice, usability and optimisation but was riddled with issues, from layout/editing issues (the justified text was unbearable, and it had numerous mistakes), to issues with the binding and over-all quality. On their end of the release I believe Smashing Magazine also had production delays too. The second book is cut from a different cloth in terms of production quality, and article subjects, this time talking more about the philosophies of graphical design, user experience, user behaviour and typography (amongst other topics). The issues of the first book are now gone, with a lot more time gone into editing/layout, and now contained in hard backing, the book feels like it’s a lot higher quality. At the start of each section there are illustrations by Yiying Lu (the creator of the Twitter “fail whale” illustration), which provide a good graphical representation of the subject of each section. This book is less code-heavy than the first, but features a lot of good quality reading material. Page layouts seem a lot nicer and the articles contain colourful screenshots and representations of what is being discussed, which do a good job of breaking the pages up - though from time to time you will find yourself facing a wall of text, which makes it not ideal for commute-reading in chunks. Overall I would say this is a much better book than the first Smashing Book. It’s a steal at the same price as the first, and a great resource for any web designer to have on their desk or book shelf. I look forward to the next Smashing Book when/if it’s released and I hope that Smashing Magazine consider re-releasing their first Smashing Book as a hardback second edition.

    • 2 min read

January

  • Grooveshark view-modes userscript for Fluidapp/Chrome/GreaseMonkey

    I’ve created a userscript to give the Grooveshark website some view modes. This is specifically for use with Fluid, but I imagine it would work okay with Chrome/etc too. More information about the userscript/setup after the break!

    • 3 min read
  • Redesigning and relaunching Dingoonity

    Over the weekend I relaunched Dingoonity.org. I launched the site back in November 2009, a bit of a rush job as far as the design of the boards was concerned — it coincided with me getting a full-time web design job at RS Components, so while giving the paid job my 100%, Dingoonity’s design got neglected.

    • 3 min read