Category Archives: Computer Related

A blank canvas for your browser… and another nifty hack

Sometimes it’s the little things that make us productive (i.e. new browser tabs). I use many browsers and get teased regularly for having a hundred tabs open and hogging the memory of my pc, but amid all those tabs, and God forbid plugins you installed in your browser, there is a disconnect between the new tab page for each. You could call it visual clutter and disuniformity… or you could call it boring, whatever floats your boat.

If you use Chrome you will probably see something like this (FYI I had a theme installed at the time of the screenshot so yours might look “cloudy”) :

Chrome New Tab

Chrome New Tab

It has the small icons for recently visited pages and another search bar.

If you use Firefox you might get something like this:

Firefox New Tab

Firefox New Tab

It just has the recently visited pages but those icons are huge.

If you want something more productive and simple I recommend this little hack; paste this into your address bar and press enter:

data:text/html, <html contenteditable>

Peaceful isn’t it?

Did you notice it? Or were you just angrily looking at a white screen? Well if you clicked on the screen and started typing you would see that this white space is now editable! What this means is that this whole screen is now a fully equipped HTML notepad for you to write on.

This means you can copy and paste text and it will retain it’s hyperlinks and formatting; so maybe we can call this the poorman’s HTML editor too as all you have to do is then save the page and you have an actual HTML page you can host.

Advanced Tip:
If you want to take it to the next level, you can make this hack your default “New Tab” behavior. Follow this article to add an extension to Chrome or Firefox (sorry IE Users) and make this your new setting.

Have Fun 🙂

Advertisements
Tagged , , , ,

This little script lets your iOS users know your site can be added as an app

If you have navigated to some sites on your iPhone or iPad recently, you may have noticed the “Add to Home Screen” balloon. This lets users add the current mobile friendly website installed as a web app on their iOS Screens.

Add To Home Screen Floating Ballon

Add To Home Screen Floating Balloon

I thought this could be a useful addition to a responsive site I’m working on so I searched how to get this working. To my surprise and delight I ran into Matteo Spinelli’s website. He’s published a nifty little script and some CSS to quickly add this to your web apps.

The full article can be found here. I haven’t had issues with it on iPhones although on iPads it looks a little rough around the edges. I still recommend you give it a try, I promise it will be time well spent :-).

Tagged , , , ,

“Mobilize” your existing SQL Azure tables (from WASD to ZUMO)

I have been playing around with Windows Azure Mobile Services (ZUMO) and found a great article on Using an existing Azure SQL table with Windows Azure Mobile Services by Jeff Sanders. I have been trying to do the same but found some challenges along the way.

If you are using EF Data Migrations on you project you will need to ensure the schema is set to the name of the Mobile Service name instead of dbo (this might be tricky for some); or use the EF DB First Model approach. In addition to that you will need to make sure the column types being used by your app are compatible with the types for ZUMO. Lastly remember to set the id (Not ID as it is case sensitive) column to be an identity column.

With those small changes you will be able to access your previously created tables via ZUMO while minimizing impact to any legacy webapp you may have developed earlier.

Hope this helps 🙂

Additional References:

Moving an Access DB to Windows Azure Mobile Services by Scott Klein

Creating a EF DB First Model with SQL Azure by Julie Lerman

Using existing database with Azure Mobile Services by Filip Woj

Do you or do you not know about the VERB… Cause everybody’s heard that the VERB is the word

Like Peter Griffin said the bird is the word, I say the VERB is the word. What I’m I talking about? HTTP Verbs.

I have been recently playing with Windows Azure Mobile Services commonly called ZUMO. In doing so I ran into a bit of a snag. I was trying to do CRUD operations from an MVC 4 app when i kept getting an error on updates. As many people know the typical mapping for REST APIs is something like this:

Read: HTTP GET
Insert: HTTP POST
Update: HTTP PUT
Delete: HTTP DELETE

While I had no issues inserting or reading the update action was failing with the following error “{“MethodNotAllowed“}. After some digging I was able to spot the issue. The ZUMO REST API is expecting the PATCH Verb instead of PUT.

I replaced the following:

var request = new HttpRequestMessage(HttpMethod.Post, BaseAddress);

with

HttpClient client = new HttpClient();
client.DefaultRequestHeaders.Add("X-ZUMO-APPLICATION", ApplicationKey);
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var request = new HttpRequestMessage(new HttpMethod("PATCH"), BaseAddress + contact.id);

That little tweak did the trick!

Hope this helps others playing with Windows Azure Mobile Services too. If you haven’t go ahead and give it a try 🙂

Google your SQL

We all have one snippet that we use several times daily (excluding logins/passwords), well here is one i like when working in SQL:

USE <DATABASE_NAME>
SELECT ROUTINE_NAME, ROUTINE_DEFINITION, LAST_ALTERED
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_DEFINITION LIKE '%KEYWORD%'
AND ROUTINE_TYPE = 'PROCEDURE'
ORDER BY ROUTINE_NAME

I call it my very own tiny Google. I am sure this has been posted before but I wanted to share it again. Not only you will get a much smaller set of stored procedures to look into but you also have a sense of when was it last modified (with this version).

Now, what do you paste more than 100 times a day?

Manage your files graphically

I can’t believe I still go back to this app, but I just can’t argue with simplicity. Have you ever wanted to know which files or folder are the elephants in your hard drive? Well if this is your case try SpaceMonger. This nifty utility will show you in scale your files and folder according to size on drive.

SpaceMonger treemap

SpaceMonger Treemap

If you do find something better send me a comment and I’ll surely try it out.

Update: Thanks to @cyberllaco for letting me know that WhatSize has the same functionality for Mac users.

WordPress + Windows Live Writer 2011

I am glad to hear that Windows Live Spaces will now use WordPress as their default blogging platform. For those (rare individuals) who use Live Spaces a tool will be offered to move your content to WordPress.

And along the same lines comes the announcement that Windows Live Writer (which I love!) will also default to WordPress.

Tip: Check out some cool WordPress plugins for Windows Live Writer here.

Tagged ,

I’m in Plugin Hell

Doesn’t it suck when you get so used to a plugin that you assume it is part of the original product? To the point where you refuse to use other people’s system if they don’t have that plugin installed… yes I know!

Sadly when that same plugin decides to “Go Rogue” it really wipes the smile of your face. I had that happen using one of the most popular extensions for Visual Studio: Productivity Power Tools (free). For those of us using the Ultimate version of VS2010 Going to the Data Menu is a lost cause. Schema Compare and Data Compare both crash VS upon clicking.

For those in the same pickle…  I have found a hack to keep on working but it really doesn’t solve the issue.

Tagged ,

A brighter future for WordPress

I am glad to discover that on WP 3.0 WordPress and WordPress MU have merged. For all those running WP and holding off on using MU this are some cool news.

Also some new plugins open new doors to flexibility and adaptable code. HookPress is a plugin that offers webhooks, these can be used to develop Push notifications (very popular now due to some mobile devices) and more. It is still in a development phase but I believe it can lead to many more automated publishing schema.

When you need more than one Unique ID {NEWID(), NEWSEQUENTIALID()}

Reading up on SQL Server Central article (Randomizing Result Sets with NEWID) on how to implement real Random sets I considered writing about the importance of GUID‘s and their most common implementation.

We typically use integer numbers as primary keys in most of tables but when non persistent data (or session data) is manipulated using a GUID becomes a necessity. We do know there is a slight chance that a GUID could be repeated but it is so low the benefits of using it make this depreciable. commonly we use NEWID() as the default value on a uniqueidentifier column but the benefits in querying and overall readability make NEWSEQUENTIALID() a better suit in this case.

As an example imagine a web application that collects user data but does not store it in your tables until user creates a login or account. We can handle most of this information on a separate table and XML drafts and link the two with these unique GUIDs.

So go ahead and give them a try it will sure come in handy some day.

%d bloggers like this: