Nov 20

Working with images: and css…

In many cases we find ourselves with no other choice but to map links onto an image. I’ve had to do this myself quite a lot, so here is a dumping ground of useful tools/hints/code to help along the way:

 

function coords(event){
posx = event.offsetX?(event.offsetX):event.pageX-document.getElementById("pointer_div").offsetLeft;
posy = event.offsetY?(event.offsetY):event.pageY-document.getElementById("pointer_div").offsetTop;
console.log(posx,posy)
}

Permanent link to this article: http://mrtechie.ie/blog/?p=161

Jul 06

Git cheat sheet

This is my own personal cheat sheet, as I always seem to be googling the same thing:

 

Recover a deleted file:

git checkout  "previous-commit-hash" "file"

Squash commits (rebase):

git rebase -i "base_branch"

Ignore files already in the repo:

git update-index --assume-unchanged config/database.yml

cherry-pick

git checkout -b <new branch>
git cherry-pick <commit hash from other branch>

List of branches merged into another branch

git branch --merged <another branch>

Delete multiple branches starting with some_string

git branch -D `git for-each-ref --format="%(refname:short)" refs/heads/some_string\*`

Permanent link to this article: http://mrtechie.ie/blog/?p=132

May 29

Microsoft takes over: Skype 5.3 fails

Hi All,

No doubt a lot of you have had problems using skype recently, I know this, because 80% of my company using skype 5.3 had heart attacks, withdrawal symptoms as well as verbally assassinating everybody in IT.

Looking on the forums you get the usual “I know what I’m talking about” suggesting changing the compatability settings and messing with the “Data Execution Protection”. This all led nowhere, but after googling “Skype 5.3 fail” and close to admitting defeat. I found this:

Delete the file located in : “C:\users\%username%\%AppData%\Skype\shared.xml”

For those less technical you can do the following:

  1. Hold down the windows button and press ‘r’
  2. Copy and past “C:\users\%username%\%AppData%\Skype\l” into the appearing box and press ‘enter’
  3. Find a file called ‘shared.xml’. It may come up as just ‘shared’ but delete it anyway.
  4. Start skype up again and hey presto! You have a working skype

 

This has worked for everybody I’ve spoken to so far. Hope it helps you!

Abe

Permanent link to this article: http://mrtechie.ie/blog/?p=90

Oct 29

Why techies hate Internet Explorer (especially ie6)

Internet Explorer, over 50% of the browser market, and probably the worst browser for deciding to do its own thing.

For those of you that don’t know, when you build a website, there are general “standards” you follow when designing a website. These standards are like agreed ways to speak a language, for instance, “If I say hello, you say hello back”. This is a very simple rule that everyone can follow, no matter where you are or where your from, as long as you understand English.

Keeping with this example, on saying “Hello” to Internet Explorer, Explorer says “Oh Hi, <insert random phrase here>”, when the agreed standard (XHTML) was, “Say Hello Back”. So, as a web designer/developer, you have to cater for this random behaviour. For example, if the random phrase is “How are you”, your website better be ready to reply “OK”. This randomness is not seen in many different browsers, and really isn’t necessary.

This seems like a very small concern, but when a website can contain over 100 pages, with “conversations” being a lengthy dialogue, these work arounds for Internet Explorer becaomes both time consuming and incredibly annoying. The randomness doesn’t stop there either, depending on the version of IE your using, your website can look so tastey it hurts, or the after math of a donna kebab.

Permanent link to this article: http://mrtechie.ie/blog/?p=85

Oct 25

Which anti-virus/security should I use?

This is a question most people have asked us in the past. Here we will go through the best of both the free and the non-free, while guiding you on what NOT to pay for.

First up, what to use for free

  1. Clamwin
  2. Malwarebytes

These two, in my opinion, are the best free tools around. The only problem is, with clamwin, you need to manually scan your hardrive rather than having real time scanning of active files. This isn’t really an issue, seen as you should do a manual scan anyway. Clamwin also supports scanning incoming emails for viruses (through outlook).

malwarebytes is more targeted towards spyware and malware (hence the name). Again this requires you to manually scan every so often, but you can pay for real time protection.

If you want to pay….

If you want to pay for a (cough) more advanced and supported protection plan, we generally go for NOD 32, this is the least intrusive of the security bundles available, and frankly, less of a pain in the ass.

Don’t buy

stay very far away from both Mcafee and symantec security products. In nearly every case these two products are installed, they’ve caused problems. Being it blocking well known programs that are not threat, to corrupting data and causing havoc on windows systems. They cause more problems than they solve. STAY AWAY

Permanent link to this article: http://mrtechie.ie/blog/?p=72

Oct 24

Print “Hello world” in PHP

Code

<?php echo "Hello World!" ?>

“echo” is a default function in php that does the printing of the string afterwards

To get this working yourself on a php server, copy the code show above and save it to  file “hello.php”. If your using notepad, make sure you save the file as “.php” at the end rather than “.php.txt”. Once saved, you can copy this file the root of your web server/space.

 

After Navigating to my-server/hello.php, you should see Hello World in the browser. Congrats on your first php page!

Permanent link to this article: http://mrtechie.ie/blog/?p=21

Oct 14

Recovering your MySQL password

Just gimme the code!

/etc/init.d/mysql stop
mysqld_safe --skip-grant-tables &amp;
mysql -u root
mysql> use mysql;
mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
mysql> flush privileges;
mysql> quit
/etc/init.d/mysql stop
/etc/init.d/mysql start
# mysql -u root -p

Explanation

Basically your restarting mysql in safemode, and turning off the ability to use passwords (grant tables).

You then login as root and change your password for root.

Remember while in this mode anybody can login as root until you restart mysql back into default mode, and the database will go down, so make sure all dependencies are accounted for :)

Permanent link to this article: http://mrtechie.ie/blog/?p=4