• upgrading to Jekyll 3 ·

    I went down a šŸ‡ hole yesterday when I decided I wanted to try a new CSS framework. It started innocently enough, I found Siimple and figured Iā€™d give it a try here. Siimple has SCSS files so I wanted to import them directly rather than used their minified distribution CSS. However, I got an error running Jekyll 2 when importing their SCSS. Though I filed an issue on their repo, I figured maybe it was a problem that would go away if I updated my Jekyll version. I used Chaseā€™s handy gems-cli tool to grab the latest version of Jekyll to put in my Gemfile and, while I was at it, I updated nokogiri, kramdown, coderay, mini_magick, rake, and mechanize, too. I figure if youā€™re going to upgrade a gem, go big or go home, right?

  • making a Philips Hue home ·

    Jon has done a great job getting our house wired up with Philips Hue lights. Iā€™ve really enjoyed having them and with the right devices, theyā€™re very convenient. I love the bits of color and how much control we have over brightness compared with regular bulbs that donā€™t have dimmer switches. I wouldnā€™t have known where to get started, so I wanted to write up the products weā€™ve bought and our experience with lights and devices.

  • Arel and tags ·

    I love working out ActiveRecord and Arel queries in Rails apps. I thought Iā€™d share some of the more fun queries Iā€™ve designed in Arel, spread out over a few blog posts. Weā€™ll start with one for fetching tags separated by account.

  • JavaScript as JSX in Sublime Text per project ·

    Iā€™m trying to learn ReactJS and it got tiresome for me to change my file type in Sublime Text from regular JavaScript to ReactJS > JavaScript (JSX) every time I opened a .js file. Fortunately, with a couple Sublime Text 3 plugins, I was able to get this happening for me automatically.

  • my collection of OS X Yosemite upgrade fixes ·

    I upgraded from Mavericks to Yosemite on my MacBook tonight and thought Iā€™d share some of the fixes I had to apply to get my development environment set up again. Iā€™ll continue to update this post as I discover new things that arenā€™t quite working the same as before.

  • triggering events in an iframe ·

    Recently, I had need to change the value of a select menu in an iframe from the outer page containing the iframe. There was a change event listener that had been added in the iframeā€™s JavaScript:

  • updating Jekyll to version 2 ·

    I was excited to see the Jekyll turns 2.0.0 blog post announcing built-in support for CoffeeScript and SASS. I updated 3till7 and my portfolio to use the latest Jekyll. This in turn meant I did away with my custom plugins for compiling CoffeeScript and LESS, and moved from LESS to SASS. Here on 3till7, I stopped using the Jekyll Asset Pipeline to compile my assets and produce a combined, minified file. Using imports in my .scss files was sufficient for me CSS-wise, and my one CoffeeScript file is small enough that I donā€™t care it isnā€™t minified. I actually havenā€™t checked, but I wouldnā€™t be surprised if Jekyll 2 supports JavaScript minification like you can do with your SASS.

  • Switching from WordPress to Jekyll ·

    Over the course of a little less than a week, I migrated this blog from WordPress 3.8 to Jekyll. I used WordPress for years, probably since 2005 or 2006 when I switched away from Movable Type. I finally decided I wanted something more lightweight than WordPress, and in particular I wanted a blog that would load faster. Jekyll gives me both of those. The part that took the longest to migrate was customizing the new layout, based on Dbyll, and formatting the code examples in my posts.

  • setting up WordPress mail on CentOS ·

    Today at work I set up a WordPress install on CentOS Linux so that it could send email. Itā€™s pretty useful and almost required to have this working, since if you forget your password, WordPress needs to send you an email to reset it. Thatā€™s how I discovered mail wasnā€™t set up correctly, actually: a user tried to reset their password and WordPress gave an error about ā€œemail could not be sentā€, and no email was received. Fortunately it was pretty easy to fix.

  • simple slider menu with jQuery ·

    There are possibly a million tutorials out there about jQuery and menus, but there werenā€™t a million and oneā€¦ until now! ;) I recently had cause to make a sliding drop-down menu for a project at work and thought I would write up how I did it. First off, check out the demo. The commented source code is below.

  • custom WordPress Events Manager event tag archive page ·

    Using the Events Manager WordPress plugin at work, I noticed that the event tag archive pages showed only current and upcoming events with a given tag. I wanted them to show all events, including past events, with the tag. I made a custom loop to accomplish this, within the Genesis framework. Create a file called taxonomy-event-tags.php in your Genesis child theme:

  • creating a custom theme based on the WebSphere Portal 7.0.0.2 theme ·

    Recently at work I was tasked with creating a customized Portal theme based on the new 7.0.0.2 theme, which uses Dojo 1.6 and thus supports IE9. I followed all of IBMā€™s steps for making a copy of the 7.0.0.2 themeā€™s static files (the non-JSP stuff that you can access via WebDAV), but still my custom 7.0.0.2 wouldnā€™t load for me. I didnā€™t modify anything in my copy from the original except the metadata to change the theme name. When I would select my copy as a pageā€™s theme or the Portal default theme, I would just get a white page with a snippet of XML up top, sometimes including an error message. When I checked the Portal logs, I saw error messages pertaining to PageBuilder2ā€“what? PageBuilder2 is the old Portal theme, and the new 7.0.0.2 theme didnā€™t seem to mention PageBuilder2 anywhere. If youā€™re experiencing this, hereā€™s what I did to fix it.

  • Portal 7 mobile theme installation woes ·

    I hassled with trying to install the IBM WebSphere Portal Mobile Experience, following the instructions on IBMā€™s web site, but the theme never showed up on my Portal site. Turns out you need to go into your IBM/WebSphere/PortalServer/theme directory and edit components.properties. There should be one line in there:

  • Converting a Word .docx file to a PDF on the iPad ·

    In case anyone else has the need to do this, Iā€™ll explain how I converted a .docx file to a PDF on my iPad 2. The fact that I feel the need to write a tutorial on how to do this should be a big hint to the folks at Apple that their file management system, or lack thereof, needs work. :/

  • Grub Error 13 and 17 together ·

    I just encountered Grub Error 13 and Grub Error 17 for seemingly no reason. I fixed the problem and thought I could save others undue headache by explaining my fix here.

  • make your Mac listen up ·

    Iā€™m so tickled I canā€™t stand it. All right, so Speech Recognition stuff on a Mac is pretty darn cool by itself, but now Iā€™ve got a nice Apple Script that opens up Safari with various tabs of my favorite sites, and it does this when I tell my Macbook ā€œGet on it.ā€ Hereā€™s how I did it:

  • Grub Error 17 ·

    Note: if this tutorial doesnā€™t help you, possibly because fdisk reports your known Linux partition correctly as Linux, you might also try my Grub Error 13 with Grub Error 17 tutorial.

    I just had an interesting time with trying to boot into Linux on my PC. Last night, I noticed my /boot/grub/menu.lst file had gotten overwritten when I performed some Ubuntu updates. This meant I had to add in configuration to allow Windows to boot, and since I didnā€™t have a backup of my old, working configurationā€“mistake number 1ā€“I looked online. I found something that looked like it would work, even though it had Grubā€™s hide and unhide commands in the configurationā€“mistake number 2. I rebooted and successfully got into Windows.

  • using Javascript and CSS to mark outgoing links ·

    It may be useful to your visitors to know which links will take them off of your site without having to hover over all of them. It might also be a nice touch to mark links pointing to PDF documents, for example, with a little Adobe PDF logo. With the help of Javascript and CSS, you can do this pretty simply.

  • using AJAX to implement a live search ·

    I recently implemented a live search on the quotes page, so I figured Iā€™d give a tutorial on how I did it. A ā€œliveā€ search is like a regular search feature, but if the user has Javascript enabled, the search will run as they type, instead of waiting for them to hit the ā€˜Submitā€™ button. There are a couple of advantages to this, one being that itā€™s a bit quicker than a traditional search because it starts working immediately; another advantage is that it might help you narrow down your search better (e.g. you initially want to search for ā€˜frogsā€™, but you get just ā€˜frogā€™ typed in and see results that interest you that wouldnā€™t have seen with a ā€˜frogsā€™ query). However, I think the main benefit from a live search is that itā€™s cool. :)

  • using AJAX to spiff up a gallery ·

    Lightbox is nice and all, but sometimes I find it clunky, particularly in Firefox when I have a lot of other tabs open. However, I donā€™t want to go the route of having an image load by itself in the browser, because it would be so much nicer to have it integrated into my layout. I could have a whole bunch of separate pages, one for each image, and do a full page load when a thumbnail is clicked, but thatā€™s kind of a hassle. Well, with a simple PHP script and some AJAX calls, I can have my image load within the gallery page without a page reload.

  • how to reformat your pen drive ·

    USB pen drives are everywhere these days, and for good reason, since theyā€™re dead useful. I use mine with my Linux box, my Powerbook, and various other systems Iā€™ve had cause to stick it in. After a while, my 1 GB drive was only holding a few hundred MB. When I would do an ls -a on it, I would see several hidden directories, such as .Trashes and .Trash-sarah. Trying to sudo rm -rf .Trash\* would fail out, however, giving complaints of a read-only filesystem. If youā€™re having such problems, or just really want to make sure your drive is clean, you can reformat it easily in Linux. I reformatted mine using Ubuntu, so the instructions have a slight bias; your mileage may vary. Warning: reformatting your pen drive will delete all its contents.

  • using Perl and Apache on OS X ·

    Iā€™m trying to do some work with a Perl app on my Powerbook but I was unable to get any Perl scripts to execute from my local server. At first, I was getting just the source of the Perl files spit back at me. I followed a few tutorials about getting /etc/httpd/httpd.conf set up, but then I kept getting 403 Forbidden errors when I tried to access .pl or .cgi files in my browser. I checked /var/log/httpd/error_log and saw:

  • simple Rails preference storage ·

    So youā€™ve got some Rails application and you need to store information from the users across their interactions with the app. Hereā€™s a simple, straightforward way to do that.

  • custom shapes in Photoshop ·

    Custom shapes can be very useful for making multiple objects that look the same. For example, say you want several photos to all be cut out of the same shape, like this: flamingo

  • if succinctly ·

    In Ruby, if is an expression, not a statement, thus it returns a value. This may not seem useful at first glance, but it lends itself to forming neat, concise codeā€¦ Like most things in Ruby, actually.

  • the power of yield and super ·

    The two keywords yield and super allow you to pass control back and forth between parent and child methods, to weave power between a more general method (in the parent class) and a more specific method (in the child class) with ease and logic. Using yield and super effectively can help you maintain the DRY (Donā€™t repeat yourself) principle, keeping your code easier to maintain.

  • image generation in PHP ·

    Creating images on-the-fly can be a very useful skill. Using PHPā€™s built-in image generation functions, itā€™s pretty easy, too. This tutorial will detail how to have the titles of blog entries show up as automatically generated images.

  • ad blocking through /etc/hosts ·

    There are several ad sites that youā€™ll see being used everywhere. They slow down page loading, even on fast connections, because sometimes thereā€™ll be lag and they wonā€™t load immediately and instead of being able to read that interesting news article, youā€™re stuck waiting for some Flash animation to show up so you can ignore it. A simple way to make those ads 1) not show up and 2) not cause delays in page loading is to edit /etc/hosts. Check out hostsfile.mine.nu for ways of doing this in Windows and Mac.

  • non-English characters in Linux ·

    Itā€™s easy to make accented characters (e.g. Ć© and Ć¼) in Linux. Easier than in Windows, actually, because in Windows you have to remember all those crazy Alt codes, and in Linux, itā€™s logical combinations of accents and letters.

  • extracting audio from a DVD ·

    Itā€™s pretty easy to extract just the audio from a DVD in Linux, using Mplayer, sox, and either Audacity or split.

  • beginning Linux guide ·

    This was taken from an email I sent to Jem and Trinity about beginning in Ubuntu Linux. It might also be useful to see my dated Beginning Linux Commands guide. Any questions about something I do or donā€™t have on here, as well as your own Linux tips, can be posted as comments.

  • extensionChanger.pl ·

    This script will rename all files with one extension to another extension. Example: all files in a given directory that end with .php will be renamed to end with .txt.

  • enqueue and dequeue ·

    Source for enqueue() and dequeue() functions to add and remove data from a queue in a class.

  • Makefile ·

    In a Unix environment when working with C++ or C, a Makefile can be a very handy thing. Instead of typing several separate commands each time you update a file and want to recompile, you can just type make and the Makefile is executed.

  • random quotes with PHP ·

    So you want to display a randomly selected quote on your page, and you want to use PHP to do it; youā€™ll need PHP support on your server. An easy way to test this is to stick <?php phpinfo(); ?> into a .php file, upload that file to your server, and load it in your browser. If you get a huge table with information about your PHP setup, then you know you have PHP support. If you get a blank page, then you donā€™t have PHP. :(

  • more dynamic sites through PHP ·

    A couple of reasons to use PHP in your site:

    1. Separation of content from designā€“when you want to change the look of your page, you can update a few files and every page of your content will be updated with those changes.
    2. You have more power than if you used some language such as JavaScript, because it doesnā€™t matter what the visitor has enabled in his browser.
  • Beginning Linux commands ·

    A table of commands that were useful to me when I first began using Linux. Note that all of these may not apply to your particular distribution, configuration, etc.