<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>${1:${TM_FILENAME/((.+)..*)?/(?2:$2:Page Title)/}}</title>
<link rel="stylesheet" type="text/css" media="screen" href="css/master.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
$0
</body>
</html>
Tag Archive for textmate
HTML5 TextMate Snippet
jquery document ready
$(document).ready(function () {
// Code here
});
Accessible Forms CSS
form.cmxform fieldset,form#standardForm fieldset{margin-bottom:10px;border:1px solid #ccc;background:#f0f0f0;}
form.cmxform fieldset fieldset,form#standardForm fieldset fieldset{background:none;border:none;}
form.cmxform legend,form#standardForm legend{padding: 0 2px;font-weight:bold;}
form.cmxform label,form#standardForm label{display:inline-block;line-height:1.8;vertical-align:top;}
form.cmxform fieldset ol,form#standardForm fieldset ol{margin:0;padding:0;}
form.cmxform fieldset li,form#standardForm fieldset li{list-style:none;padding:5px 10px 7px;margin:0;}
form.cmxform em,form#standardForm em{font-weight:bold;font-style:normal;font-size:130%;color:#f00;}
form.cmxform label,form#standardForm label{width:120px; /* Width of labels */}
form.cmxform label.wider,form#standardForm label.wider{width:150px;}
form.cmxform textarea,form#standardForm textarea{font-size:100%;font-family:verdana;}
form.cmxform .autoSize,form#standardForm .autoSize{width:auto;border:none;}
form.cmxform input.submit,form#standardForm input.submit{cursor:pointer;border:1px solid #fff;background:#84b84a;color:#fff;font-size:110%;font-weight:bold;padding:3px;}
form.cmxform input.submit:focus,form#standardForm input.submit:focus{background:#84b84a;}
form.cmxform select,form#standardForm select{width:300px;}
form.cmxform input.widerInput,form#standardForm input.widerInput{width:300px;}
Jquery Accessible Forms Code
$(document).ready(
function()
{
if($.browser.mozilla)
{
$("form.cmxform").find("li > label").not(".nocmx").each(
function(i)
{
span = document.createElement("span");
$(span).css({ display: "block", width: $(this).css("width") });
$(this).css("display","-moz-inline-box");
$(span).html($(this).html());
$(this).html("");
$(this).append(span);
}
);
}
}
);
EE Contact Form
{if segment_2 =="thanks"}
<h1>Many thanks</h1>
<p>We have now received your message and will be in touch shortly.</p>
{if:else}
{exp:freeform:form form_name="contactForm" form_class="cmxform" form_id="standardForm" required="name|email|comments" notify="jim@sixmedia.net" template="contact_form" return="/contact/thanks/"}
<fieldset>
<legend>Your Contact Details</legend>
<ol>
<li>
<label for="name">Name: <em>*</em></label>
<input type="text" id="name" name="name" size="40" />
</li>
<li>
<label for="email">Your Email: <em>*</em></label>
<input type="text" id="email" name="email" size="40" maxlength="35" value="" />
</li>
</ol>
</fieldset>
<fieldset>
<legend>Comments</legend>
<ol>
<li>
<label for="subject">Subject:</label>
<input type="text" id="subject" name="subject" size="40" value="" />
</li>
<li>
<label for="comments">Message: <em>*</em></label>
<textarea id="comments" name="comments" rows="10" cols="60"></textarea>
</li>
{if captcha}
<li>
<label for="captcha">Enter the word you see in the image: <em>*</em></label>
<input type="text" id="captcha" name="captcha" value="" maxlength="20" /><br />
{captcha}
</li>
{/if}
</ol>
</fieldset>
<p><input name="submit" type="submit" value="Send Message" /></p>
{/exp:freeform:form}
{/if}
Add a directory to your PYTHONPATH in Terminal.app using TextMate
#open your .bash_profile by typing this into Terminal. You'll need to be in your home directory. sudo mate edit .bash_profile # Paste something like this into your .bash_profile export PYTHONPATH=$HOME/Sites/dev:$PYTHONPATH
HTML5 Skeleton
<!DOCTYPE html> <html> <head> <meta charset=utf-8 /> <title></title> <link rel="stylesheet" type="text/css" media="screen" href="css/master.css" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <!--[if IE]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> </head> <body> </body> </html>
Subversion export with PHP Script
//http://th.php.net/manual/en/function.svn-export.php <?php $working_dir = '../'; $new_working_dir = '/home/user/devel/foo/trunk'; svn_export($working_dir, $new_working_dir); ?>
Simple SVN checkout using PHP
// <a href="http://www.fordnox.com/blog/2008/11/simple-svn-checkout-using-php/" >http://www.fordnox.com/blog/2008/11/simple-svn-checkout-using-php/</a>
$username = "username";
$password = "password";
$repository = "http://google-web-toolkit.googlecode.com/svn/trunk/";
$destination = ‘your/full/path’;
$checkout = "svn export –force –username $username –password $password $repository $destination";
$result = _exec($checkout);
function _exec($cmd)
{
if (substr(php_uname(), 0, 7) == "Windows") {
pclose(popen("start /B ". $cmd, "r"));
} else {
exec($cmd . " > /dev/null &");
}
}