Getting Mercurial to Ignore Stuff

Posted by John
on Saturday, 15 November 2008

Mercurial

Simple to do, first make your .hgignore file:

gedit .hgignore

Add to this some basic syntax

syntax: glob
*.sql
*.gz
.DS_Store
public/cache/*

(basically here you're telling mercurial what file extensions and directories to ignore in your app's root directory)

Save & close the file (nano: CTRL+Y, VI:esc then ':wq' + enter), now when you do hg add . and hg commit it'll skip these files & directories and keep your repository clean storing only the things you need to worry about; the code.

The Oceans Cons

Posted by John
on Saturday, 16 February 2008

Oceans 13

In all of the Ocean's movies they use some nice codewords to describe certain cons and tricks of the trade, so what i've done is break them down into layman's terms...

Enjoy!,

Oceans 11 cons

  • Boesky => a wealthy bankroller with insider info
  • Jim Brown => confrontation between two people, to distract lifting info
  • Miss Daisy => driving miss daisy, e.g. a SWAT vehicle as a getaway car
  • Two Jethros => two guys used to distract and general grunt work
  • Leon Spinks => disruption of a boxing match
  • Ella Fitzgerald => tape looped back to look like a live recording

Oceans 12 cons

  • Bundle of Joy => pregnant woman
  • Smugglers Paradise => needs 2-3 people, undescribed
  • Swinging Priest => needs 2-3 people, undescribed
  • Crazy Larry => needs 2-3 people, undescribed
  • Soft Shoulder => needs 2-3 people, undescribed
  • Bakers Dozen => needs 2-3 people and a girl, undescribed
  • Hell in a Handbasket => needs 2-3 people and a cat, undescribed
  • Lookie-loo => someone who looks like another, doppleganger

Oceans 13 cons

  • Billy Martin => a second chance
  • Irwin Allen => promise of impending disaster (IA made disaster movies)
  • Susan B. Anthony => a coin that has more value than the player thinks
  • Brody => false nose
  • Gilroy => pheromone used to make someone more persuasive
  • Cartwheel => quick distraction to cover up something

Quickie : Inline Javascript

Posted by John
on Tuesday, 18 December 2007

Although embedding javascript blocks within a page isn't strictly code-worthy, it's a good start to get things going.

<script type="text/javascript">
<!--
function helloWorld() {
    alert('Hello World!') ;
}
// -->
</script>

Here we're defining the function helloWorld(), which when called will open an alert window containing the text 'Hello World'.

Note the definition...

<script type="text/javascript">

This is all we need to define our inline JavaScript block.

Don't use language= as this isn't strictly valid...

<script language="javascript" type="text/javascript">
--wrong-- 'language' definition invalid

Rails => Forgot your Password code...

Posted by John
on Wednesday, 07 November 2007

Finally got around to adding a 'forgot your password' feature to AtomPad.com.

For the rest of you, I found an excellent example online at...

I changed the Find_By to the following as Mongrel doesn't seem to like dynamic finds,

In forgot password method...

if @user = User.find(:first, :conditions => [ "email = ?", params[:email] ])

And reset password method...

@user = User.find(:first, :conditions => [ "pw_reset_code = ?", params[:id] ] ) rescue nil

Nice to have that problem out of the way,

AJAX + Prototype = Rockin!

Posted by John
on Wednesday, 19 September 2007

Ahh… times are good.

Not much of an article more of a message.

Well if you know I’ve spent the past 2-3 months putting together a neat little rails app called AtomPad , it’s really my take on BaseCamp and is a perfect platform to test my Ruby skills and sharpen my OOP mentality.

So far it’s proven to be pretty useful and today I’ve re-written the Reminders and Lists area to be a bit more AJAX powered. So now you can add, delete, even live-edit items right on the screen just by hovering over them; and all without one single refresh.

Plus you get version control so it records what things you change to your notes, so eventually if your in a team it’ll tell you who changed what, when and maybe why (eventually).

Very intelligent, very powerful and so damn cool.

AJAX + Prototype is most definitely king!