imgInfo Chrome Extension

June 24, 2010  |  coding, git  |  No Comments

I just published my first Google Chrome extension. I feel it addresses the lack of a feature I deem very important – image information. Get it here.

How to use it? Simply hover an image for the amount of time specified in the options page.

All sources are available on GitHub here and here.

Perl: Mass Domain Checker Script

June 16, 2010  |  coding  |  No Comments

A quick and dirty script to mass check domain names.

#!/usr/bin/perl -w
use strict;
use Socket;
no warnings;

print "checking domains...\n\n";

while(<>)
{
	chomp($_);

	if(rindex($_, ".") == -1)
	{
		$_ = $_.".com";
	};

	eval
	{
		my $address;
		$address = inet_ntoa(inet_aton($_));
		print "not available\t -- $_\n";
	};
	if($@)
	{
		print "available\t -- $_\n";
	};
}

print "\ndone.\n";

Usage:

  • Copy, paste & save the script as domainchecker – make sure you have Perl installed.
  • If you’re on a *NIX platform (Macs included) chmod 770 domainchecker.
  • Save the list of domain you want to check in a separate file, e.g: domains.txt, one domain name per line
  • Run the script: ./domainchecker domains.txt

Source Code for DEX Available on GitHub

June 5, 2010  |  git, news  |  No Comments

Direct link to GitHub page here.

Enjoy!

Valid Email NSString Category

May 27, 2010  |  coding  |  No Comments

A quick NSString addition to check if the string is a valid email address:

@interface NSString (ValidEmailAddition)
-(BOOL) isValidEmail;
@end

@implementation NSString (ValidEmailAddition)
-(BOOL) isValidEmail
{
	NSString *emailRegEx =
		@"(?:[a-z0-9!#$%\\&'*+/=?\\^_`{|}~-]+(?:\\.[a-z0-9!#$%\\&'*+/=?\\^_`{|}"
		@"~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\"
		@"x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-"
		@"z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5"
		@"]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-"
		@"9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21"
		@"-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])";

	NSPredicate *regExPredicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegEx];
	return [regExPredicate evaluateWithObject:self];
}
@end

I♥QUOTES code now on GitHub

May 2, 2010  |  git, news  |  No Comments

The source code for I♥QUOTES Reloaded is now available on GitHub.

Direct link to the repository here.

Enjoy!

Gitting it!

May 2, 2010  |  news  |  No Comments

Starting from now, I’ll try to open source as much of my code as possible. I chose GitHub to host my code as I really wanted to give git a try.

The code can be found at http://github.com/moghoul.

By the way, for git newbies like me, some really helpful tips and cheat sheets can be found here.

How to install an AdHoc iPhone application

April 30, 2010  |  tips  |  No Comments

AdHoc distribution allows you to beta test an application before it hits the App Store.

What you need to install an AdHoc application on your device:

  • The .zip file for the application.
  • The .mobileprovision file the developer provided you with.
  • The device for which the application was created (the device whose UDID you sent to the developer).

Steps to install the application:

  1. Unzip the file you received. If you’re on a Mac the zip file will contain a single file; if you’re on Windows it will contain a folder ending with .app
  2. Drag the .mobileprovision file onto the Library pane in iTunes.
  3. Drag the application file (or folder for Windows) onto the Applications tab in the Library pane.
  4. Verify that the application shows up in Applications tab. Note that it will not have its normal icon.
  5. Select your device under Devices, choose the Application tab, and make sure that the new application is checked.
  6. Sync your device and try out the app.

Troubleshooting:

  • If you encounter the error 0xE8000001 when syncing, your device thinks the application should not be allowed to install. This could either mean the developer did not add your UDID to the AdHoc certificate, or you have an old certificate that’s conflicting.
  • AdHoc applications get a generic logo when shown in iTunes, but the real logo will show when the application is posted on the App Store. This is purely a cosmetic issue.

Find out your device’s UDID

April 30, 2010  |  tips  |  No Comments

So you need to find out your device’s Unique Device Identifier (UDID).

Every device launched by Apple in the past 3 years – starting with the original iPhone – has an Unique Device Identifier. The UDID is a sequence of 40 letters and numbers.

Say you’re a beta customer and you want a preview of some app before it hits the App Store. The only way you can do that is if the app’s developer makes a custom build of the application especially for your device. But for him to be able to do that, he first needs to register your device with Apple. As UDIDs are unique, they’re perfect for this task.

There are 2 ways you can find out your device’s UDID:

  1. Install and run the Ad Hoc Helper app on your device. It will create an email with your UDID which you can easily send to the developer.
  2. Retrieve it manually using iTunes.
    1. Fire up iTunes and connect your device.
    2. In iTunes’ left pane, right above the playlists you should find your device under the DEVICES section. Select it.
    3. In the right pane you should now be able to see information about your device such as it’s name, capacity, software version and serial number.
    4. Click the Serial Numberlabel. The text will change to Identifier (UDID).
    5. Press Command+C (or Control+C on Windows) to copy the UDID to clipboard.
    6. Paste the UDID anywhere you like.

Back online!

April 30, 2010  |  news  |  No Comments

moGhoul is finally back online – for good!

I switched hosts and rebuilt everything from scratch, just for the fun of it. Mental memo to self: never do that again!

Have a good one!