Ramblings

February 27, 2012

Quicklook 2 pdf is possible!

Filed under: Uncategorized — Tags: , , — michaelangela @ 12:00 pm

I have a Word doc. I use Quicklook on it. It generates a visual but you can’t do anything with it. I wanted to print without opening MS Word. Most tips talk about using the File menu in Finder to Print… the selected file, which of course opens the doc. That’s not desirable. I couldn’t find a solution until I searched qlmanage instead of “quick look”.  Well low and behold…

Create PDFs with QuickLook – Stian’s PhD wiki

Word documents are good for editing, and better for converting to Kindle .mobi files, etc. But my academic workflow is built around PDFs, and I like using Skim for marking them up etc. I also hate having to fire up Word every time I just want a quick look at some document. Turns out you can use QuickLook to generate PDFs from any format it knows how to preview (and you can add support for lot’s of extra formats through plugins).

For the latest code:

https://github.com/houshuang/folders2web/blob/master/qlmanage-doc2pdf.rb

http://code.google.com/p/wkhtmltopdf/downloads/list

I’ll have to see if I can get this working with Alfredapp. 🙂

edit: a few different takes on it are here:

http://codesnippets.joyent.com/posts/show/14630

February 10, 2012

OpenXML node type help

Filed under: Uncategorized — Tags: , , , — michaelangela @ 7:12 pm

I’ve been investigating some possible development opportunities dealing with OpenXML. Obviously for what it has to do there is quite a lot baked in and finding out what a particular node or attribute does though can be a bit time consuming. Schema Central offers a search though. Fast and concise. Not noticing the context I was in I saw <w:b />. A quick search yielded the text below prompting me to look at surrounding nodes. Yep, makes sense. Nice.

OOXML w:b — Complete documentation and samples

w:b Bold

February 8, 2012

Skim’s reader bar has shortcuts to move it!

Filed under: Uncategorized — Tags: , , , — michaelangela @ 4:05 am

I use Skim for reading PDFs whenever I don’t need to do major collaboration with others with Acrobat. I really like it and recommend it whenever someone even remotely mentions issues with reading PDFs on OS X. One neat thing Skim has is a reading bar. It helps to focus when going through code related books, etc. I never knew how to make the most of it until today. I was thinking “it sure would be nice if you could move that reading bar with the keyboard.” I’ve thought that many times. Today I checked the suggested features and sure enough, it’s been requested and fulfilled. But it’s hidden!

SourceForge.net: Tips and Tricks – skim-app

Skim also has a few unlisted shortcuts to make life easier. Some only work in specific tool modes or when a note is selected. These shortcuts only work when the main PDF view has the focus.

space, ⇧space, page down, page up   scroll page down/up
home, end   first/last page
→, ←, ↓, ↑   scroll
⌥⌘→, ⌥⌘←, ⌥⌘↓, ⌥⌘↑   change tool mode
→, ←, ↓, ↑, ⇧→, ⇧←, ⇧↓, ⇧↑   move selected note
return   edit selected note
⌥⌃→, ⌥⌃←, ⌥⌃↓, ⌥⌃↑, ⇧⌃→, ⇧⌃←, ⇧⌃↓, ⇧⌃↑   resize selected note
⌥→, ⌥←, ⌥↓, ⌥↑   move reading bar
⇧⌥↓, ⇧⌥↑   resize reading bar
⌥tab, ⌥⇧tab   rotate through notes and links
⌥escape   deselect active note
t, n, c, b, h, u, s, l, f   change note tool mode (only in note tool mode)

February 3, 2012

FlashBuilder, the yellow question marks, the import “foo.bar” could not be found – find touch as a temporary workaround?

Filed under: flash, flash builder — Tags: , , , , , , , — michaelangela @ 11:22 pm

I was working on a Flash Pro project, coding in FlashBuilder. The way to go. The nearest I can tell is when running a debug build for some reason the project lost something. The legendary yellow squiggles with the ? marks appeared all over the place. I couldn’t get it to go away. It’s in git so I just checked it out in a new folder without the project files and could keep moving. After another debug build, it happened again. Not sure on that bit. But I found that doing ANY change in the file and saving the imported file would suddenly make the file usable again.

import com.foo.bar.MyClass

Open up MyClass and do anything that allows FlashBuilder to save it. The quickest was space/delete/save. If you have FlexFormatter on make sure auto format isn’t on if you don’t want to reformat 3rd party libraries when doing this. So it seemed that anything you change, so that it saves, brings the file back into FlashBuilder’s list of valid imports. But when you close the project and reopen it, the invalid imports are back.

That got me to thinking… if I just touch the file would that do it? It did. Now we’re in business.

find . -type f -print0 | xargs -0 touch

That did the trick. All the files are back in business. It’ll happen again but at least I have a quick way to get it working so refactoring, finding usages, hiearchy and all that goodness works again.

This is FlashBuilder 4.5.1.

May 9, 2011

Firequery, Firelogger, Firebug 1.7, Firefox 3.6 Portable

Filed under: Uncategorized — Tags: , , — michaelangela @ 4:42 pm

Just a note, when installing Firequery and Firelogger in Firefox 3.6 (portable version) I ran into the “requires additional items” error. It turns out that my Firebug was 1.7bx which is beyond the 1.7 requirement for these plugins which causes them to fail. To get them working (though I haven’t completed tested them yet of course) you just have to go to the install.rdf files for both and make a couple of tweaks. In Firefox 3 you can right click on the extension in the add-on window and go to the extension’s install directory. Open up the install.rdf in a text editor and change

        <em:maxVersion>1.7</em:maxVersion>

to

        <em:maxVersion>1.8</em:maxVersion>

and restart. Now to test…

April 30, 2011

MAMP RewriteLogging and getting a site back up online

Filed under: Uncategorized — Tags: , , — michaelangela @ 3:04 am

Short version:

Laptop logic board died.

Hard drive is fine.

Got a new laptop (not the way to upgrade!)

Client WordPress site runs fine from external hard drive and new install of MAMP. Databases copied over and such (after minor heart attack when not copying over the required INNODB files)

rsync over to local drive and it doesn’t work. “Pages” aren’t working. URLs like /?p=5 work fine. Rewriting is an issue.

Make a new host at old.clientsite.dev (with the very helpful and neat virtualhostx) and point it at the external drive. Still fine. but clientsite.dev still no go.

Tried to set up RewriteLogging but it doesn’t work. Thrash around for hours.

httpd.conf has the goods

RewriteLog “/Applications/MAMP/logs/rewrite.log”
RewriteLogLevel 3

but no go. Not sure why. Notice in /private/etc/apache2/extra/httpd-vhosts.conf that there is one difference. The old vhost has AllowOverride All whereas the new one does not. Added that, and all is good.

Back to work again.

August 28, 2010

Pros and cons of various vertical centering techniques

Filed under: Uncategorized — Tags: , — michaelangela @ 6:48 am

Just want to keep this for reference. 

In the Woods – Vertical Centering With CSS

There are a few different ways to vertically centre objects with CSS, but it can be difficult to choose the right one. I’ll show you all the best ways I’ve seen and also how to create a nice little centered website.

IE7 overflow:auto not working right?

Filed under: Uncategorized — Tags: , , — michaelangela @ 5:27 am

Briefly, the content was in the div that had the overflow: auto and the content was just going E-VE-RY-WHERE. Solution? See below. Yep it worked. Doing some work for a client that needs the legendary IE7- (IE6) support. Doing CSS fixes without hacks until HTML structure has to change. Hopefully not! But this little bit helped. 

Overflow Auto and Position Relative

The simplest fix is to apply position: relative to the containing block; the one with overflow: auto.

August 13, 2010

FlashBuilder 4 jump directly to API documentation tip

Filed under: Uncategorized — Tags: , , , — michaelangela @ 4:30 am

I was wondering if it is possible to jump directly to the ASDoc of a Flash/Flex component. Seems it is possible.

Oh my. Very nice. Place your cursor in the code of interest and press Shift + F2. And there you go. Previously I used FluidApp to wrap the AS3 reference documentation locally as noted below. But now this is not needed. On my box FluidApp’s search is faster sometimes than the Adobe Help depending on what’s running, but jumping right to the docs in question is very helpful.

Big Spaceship | Labs Blog – AIR App: AS3 Language Reference

I found the scrollbars in the air app to be shoddy, so I downloaded the offline version of the AS3 docs:

http://help.adobe.com/support/documentation/en/flash/10/ActionScript3LangRef.zip

and then created a fluid app from my local version.

http://fluidapp.com/

now runs perfect offline and even has a search.

Simplest, cleanest singleton

Filed under: Uncategorized — Tags: , , — michaelangela @ 12:31 am

This is the simplest and cleanest singleton patter I have seen to date for AS3. Let’s you set it up and get right to coding. The author does make a request for a singleton metadata tag to automatically make classes into singletons. Well we sort of have that with RobotLegs. With the injection rules you can just tell RobotLegs that any time you inject an instance of a particular class just to make it a singleton and it’ll do that in the background for you. Sweet and simple. But this code linked below is the closest non-framework solution I have seen that gets close to that in its simplicity.

ActionScript 3 Singleton Redux – darron schall

It was actually a combination of other factors (and personal preference) that made me revisit the singleton pattern. The singleton technique that I prefer was developed to address the other issues I was running into and to reflect my personal coding style. While I was at it, I figured I might as well address the private constructor issue too. After all, we all love being smacked around by the compiler sometimes.

The technique I prefer has the following highlights:

  • Usage of static instance read-only property instead of a static getInstance() function. This is somewhat a matter of style and personal preference, but I prefer the succinctness of the read-only property. This is especially obvious when the singleton is used in binding expressions. Plus, getInstance() is so 1990s Java which ActionScript is most definitely not. I kid, I kid. But seriously, “.instance” is cooler.
  • Usage of a private lock class to prevent outside construction. While this is a common theme in the above links, my approach is slightly different. Instead of passing an instance of the private locking class to the constructor, I just pass the Class reference itself. This does two things. First, it clarifies the conditional check in the constructor. The test for the proper locking Class reference communicates the code’s intent better than the traditional check for not null. Second, it encapsulates the private locking class itself. The constructor’s argument is simply lock:Class which doesn’t expose the name of the private locking class to the outside world, but still communicates that the constructor is locked.
  • Removal of ‘Unable to bind’ warnings in Flex 2. When you use a singleton in a binding expression, it’s typical to have the Console log flooded with warning messages indicating that binding to the instance property will not be able to detect updates. My singleton version fixes these warnings.
  • Use of const instead of var for the instance storage. This one is pretty obvious, but using const here communicates intent better. The variable storing the singleton instance is not allowed to change so const is the better choice.

August 12, 2010

Customizing ASDocs

Filed under: Uncategorized — Tags: , , — michaelangela @ 10:19 pm

Documentation is great. Writing it is not. Writing notes in code then pulling that into some sort of printed reference is even worse. But there are solutions. For Flash/Flex devs there are ASDoc comments. Now if you want to add your own little tweaks to it, it seems, at least in the past, this was possible.

ASDoc Enhancements | www.boristhebrave.com

I’ve put in a few customizations to the standard ASDoc template, that I’m going to share here, as they are generally useful. You will need to customize the files a bit for your own project, though.

Making a clean float clear

Filed under: Uncategorized — Tags: , — michaelangela @ 4:33 pm

This is a note for reference in case I run into some funkiness that looks like this might address. Very nice and concise.

Breaking Floats Without Hacks

When you want to clear all floats across the entire width of the page or a div, this single line of CSS code just won’t cut it when using: <div class=”clear”></div>.

  1. clear: both;

Instead, we’re going to use four lines.

  1. width: 100%;
  2. height: 1px;
  3. margin: 0 0 -1px;
  4. clear: both;

Alright, let’s break this down. First of all, the major problem with clearing correctly in all browsers lies mainly in a few of Internet Explorer’s quirks. Both width: 100%; and height: 1px; force the browser into accepting that there is a div there. The margin: 0 0 -1px; negates the 1 pixel space that height introduced; this is the only property that is not required. Natually, clear: both; is the special ingredient to make all of this work.

 

IE6 Fixed Positioning

Filed under: Uncategorized — Tags: , , — michaelangela @ 4:30 pm

When you need it you need it. I just wanted to keep a link to this.

Fixed Positioning in Internet Explorer 6

Fixed positioning has always been a nuisance for web designers because of the lack of support for it in Internet Explorer 6, but I’ve come up with a solution that allows for cross-browser fixed positioning that doesn’t come at the large costs that other techniques result in. If you’ve been on the hunt for a way to get elements with position: fixed; to work properly in Internet Explorer 6, undoubtedly you’ve noticed that most methods come at the expense of absolute positioning or resorting to scripting. Mine does not.

Faster Captivate development with a solo review

Filed under: Uncategorized — Tags: , , — michaelangela @ 4:28 pm

I’ve been working with Captivate 5 and it’s pretty nice. Coming from a Flash/Flex background I am used to the edit, build, and review workflow. Make changes, compile it (oh so much nicer in FB4+Flash CS5), and then view the changes. So I do that in Captivate, too. But I don’t have too… 

Adobe in Technical Communication and eLearning » Using a Solo Review to Edit Adobe Captivate Projects Faster [VIDEO]

In this video I go over a process that works for me, namely conducting a local, solo Review, where I can insert comments on-the-fly as I’m previewing my project. These notes are then imported back into my project exactly where I inserted them.

Simplest css based sticky footer I have seen

Filed under: Uncategorized — Tags: , , — michaelangela @ 1:48 am

And apparently all the code is semantic as well. It’s clean and light on hacks which is always good.

New CSS Sticky Footer – 2010 – HTML for Bottom of Page Footer

This sticky footer solution is working in all major browsers, including Google Chrome and IE 8! It works with
floated 2-column layouts and we don’t get overlap in resized browser windows unlike older solutions
you find when you Google sticky footer. You don’t need an empty push div or cleafix hack. Here is how to use this sticky footer code.

Create a free website or blog at WordPress.com.