MarkyH theme for gEdit

Here’s my MarkyH theme for gEdit which I use occasionally. Enjoy!

Download

markyh.png

Posted in Programming | 1 Comment

Kohana Validation Cheatsheet

Here is a cheatsheet that I copied from the Kohana docs and put into pdf format. Enjoy.

Download

Posted in Uncategorized | Tagged , | 2 Comments

Another quick fix for “The system administrator has set policies to prevent this installation” error

Just got this error the other day while working on a friend’s computer. I tried all the suggestions from here: http://www.appdeploy.com/messageboards/tm.asp?m=8872&mpage=1 but to no avail.
What finally worked was downloading and and re-installing Windows Installer 4.5. Here is the link to the download page: http://www.microsoft.com/downloads/details.aspx?familyid=5A58B56F-60B6-4412-95B9-54D056D6F9F4&displaylang=en. I hope that can help some of you.Technorati Tags:

Posted in Computers | 2 Comments

My Netbeans Theme – Markyh

Here is my theme that I use for netbeans. It’s a mixture of Dr. Nic’s theme with a little dark textmate stuff rolled in. I hope you like it. I use Netbeans on an Ubuntu Linux laptop and work mainly with php, ruby and javascript and using this theme has made things a lot easier. The font in the picture is FreeMono.

To install the theme, open the zip file and place the contents in the netbeans/$version/Editors directory. If you just want to use the colors and keep the same font, don’t overwrite the editor personal preferences file.

Pic:

Font:
FreeMono.ttf

Theme:
markyh.zip

Posted in Programming | Tagged | 7 Comments

Kohaml – Haml Module for Kohana

I’ve been itching to use Haml with my new fav framework Kohana, however I was severely disappointed by the current state of haml interpreters for php. I had a free evening the other night and decided to write my own php haml interpreter and integrate it into a module for Kohana. The end result is tada! – Kohaml,  YAHOO!!! Okay while it may not save a life, Haml will definitely save you time and stress, as long as you can keep indentation monster off your back.

Download
Github

Kohaml takes this:


!!!
%html
  %head
    %title#content.wow{a => 'hello'} Hello World
  %body
    .wow hhaha
      %strong{'class' => "code", 'id' => "message"} Hello, World! <? 'howdy' ?>
      %b Hello World
      %peanutbutterjelly
        / This is the peanutbutterjelly element
        .helloa <?= $wow ?>
        #woa was
        %br/
    #foo=   $wow
      hahaa
      %b{'class' => 'type'}= $hello
    %sandwich{'delicious' => 'true', 'more' = 'okay'}
    .wowaa he
      |<?php echo('wuttup'); ?>
    |<?php echo('wuttup'); ?>
      |<?php echo('wuttup'); ?>
        #wow.escape
      |<?php echo('okay') ?>
    |<?php echo('wuttup'); ?>
    %ul
      %li <?php 'hello' ?> jadsf <?php 'aa' ?>
      %li Pepper
      / heloaf

And turns it into this:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
  <head>
    <title "class"="wow" "id"="content" "a"="hello">Hello World</title>
  </head>
  <body>
    <div "class"="wow">
      hhaha
      <strong "class"="code" "id"="message">Hello, World! <? 'howdy' ?></strong>
      <b>Hello World</b>
      <peanutbutterjelly>
        <!-- This is the peanutbutterjelly element -->
        <div "class"="helloa"><?= $wow ?></div>
        <div "id"="woa">wasaa</div>
        <br/>
      </peanutbutterjelly>
    </div>
    <div "id"="foo">
      <?= $wow ?>
      hahaa
      <b "class"="type"><?= $hello ?></b>
    </div>
    <sandwich "delicious"="true" "more"="okay"></sandwich>
    <div "class"="wowaa">
      he
      <?php echo('wuttup'); ?>
    </div>
    <?php echo('wuttup'); ?>
      <?php echo('wuttup'); ?>
        <div "class"="escape" "id"="wow"></div>
      <?php echo('okay') ?>
    <?php echo('wuttup'); ?>
    <ul>
      <li><?php 'hello' ?> jadsf <?php 'aa' ?></li>
      <li>Pepper</li>
      <!-- heloaf -->
    </ul>
  </body>
</html>

Here is a brief overview of how to use Kohaml. The above example makes use of all the rules, check out http://SERVER_NAME/kohaml for a demo.

Rules:

  • % – Define an element tag: %b = <b>. If using % it must be at the start of line. Can be used with . and #.
  • # – Id. #content = <div id=”content”></div>. Can be used with . and %. Multiple #’s can be used.
  • . – Class. .my_rows = <div class=”my_rows”></div>. Can be used with # and %. Multiple .’s can be used.
  • { }  – specifies attributes for that element. %sandwich{‘delicious’ = ‘true’, ‘more’ = ‘okay’} = <sandwich “delicious”=”true” “more”=”okay”></sandwich>
  • <? – At the beginning of a line specifies a line of php code and the line and depth are ignored.
  • | – At the beginning of a line of php code will take that line of php into account. Use | for nesting php code within elements.
  • / – At the beginning of a line defines a comment. Comments can be nested.
  • / – At the ending of line creates a self-closing tag. %br/ = <br/>

Guidelines:

  • Putting text at the end of element declaration will wrap it. #element myText = <element>myText</element>
  • To nest element or text use 2 spaces. Haml is indent sensitive. Kohaml will raise an error on incorrect indentation.
  • Any php within a line (not at the start of a line) will be kept intact

Shortcuts:

  • #element= $var = <element><?= $var ?></element>
  • load(myTemplate) will generate a function to load a sub-view into the current file. Will also nest and indent appropriately. Declared at the beginning of the line.
  • #elment= load(myTemplate) = will load a haml template and nest it within the element
Posted in Programming | Tagged , , | 12 Comments