Skip to content

Commit

Permalink
1st commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmartineau committed Jun 23, 2011
0 parents commit 4e03f1f
Show file tree
Hide file tree
Showing 58 changed files with 2,839 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>commands</key>
<array>
<dict>
<key>command</key>
<string>changeSpacesToTabs:</string>
</dict>
<dict>
<key>argument</key>
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
<string>perl -pe 's/[\t ]+$//g'</string>
<key>fallbackInput</key>
<string>document</string>
<key>input</key>
<string>selection</string>
<key>name</key>
<string>Remove Trailing Spaces in Document / Selection</string>
<key>output</key>
<string>replaceSelectedText</string>
<key>uuid</key>
<string>0F8C1F78-6E4C-11D9-91AF-000D93589AF6</string>
</dict>
<key>command</key>
<string>executeCommandWithOptions:</string>
</dict>
</array>
<key>name</key>
<string>Convert Spaces to Tabs &amp; Remove trailing Whitespace</string>
<key>uuid</key>
<string>72713409-6BD4-43B1-8C2A-6A4FDCB965BC</string>
</dict>
</plist>
17 changes: 17 additions & 0 deletions Zander Martineau's Bundle.tmbundle/Snippets/301 Redirect.tmSnippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>Redirect 301 /${1:oldpage.html} ${1:http://www.yoursite.com/newpage.html}
301$0</string>
<key>name</key>
<string>301 Redirect</string>
<key>scope</key>
<string>source.apache-config</string>
<key>tabTrigger</key>
<string>301</string>
<key>uuid</key>
<string>432A782E-39C1-4282-9F9C-192C80CDD80B</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>&lt;!-- Asynchronous Google Analytics: mathiasbynens.be/notes/async-analytics-snippet --&gt;
&lt;script&gt;
var _gaq = [['_setAccount', '${1:UA-XXXXX-X}'], ['_trackPageview']];
(function(d, t) {
var g = d.createElement(t),
s = d.getElementsByTagName(t)[0];
g.async = true;
g.src = ('https:' == location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
s.parentNode.insertBefore(g, s);
})(document, 'script');
&lt;/script&gt;</string>
<key>name</key>
<string>Async Google Analytics</string>
<key>scope</key>
<string>source.js.html.php</string>
<key>tabTrigger</key>
<string>analytics</string>
<key>uuid</key>
<string>91998CBD-9CE2-48E8-A504-7C7792E2FE29</string>
</dict>
</plist>
22 changes: 22 additions & 0 deletions Zander Martineau's Bundle.tmbundle/Snippets/Autoscroll.tmSnippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>jQuery.fn.autoscroll = function(selector) {
$('html,body').animate(
{scrollTop: $(selector).offset().top},
500
);
}
//Then to scroll to the class/area you wish to get to like this:
$('${1:.scroll_link}').autoscroll();</string>
<key>name</key>
<string>Autoscroll</string>
<key>scope</key>
<string>source.js</string>
<key>uuid</key>
<string>0CC9EE5E-80DB-4BBE-AE0F-A8C9CA29B89D</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>//Block Clickable
$("${1:#sites li}").click(function(){
window.location=$(this).find("a").attr("href");return false;
});
$0</string>
<key>name</key>
<string>Block Clickable</string>
<key>scope</key>
<string>source.js</string>
<key>uuid</key>
<string>A415C9A8-FFF7-48D5-8F0A-C5CAFA4E3E75</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>jQuery.fn.center = function () {
this.css('position','absolute');
this.css('top', ( $(window).height() - this.height() ) / +$(window).scrollTop() + 'px');
this.css('left', ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + 'px');return this;}
$(${1:#center_this}).center(); </string>
<key>name</key>
<string>Center an element on screen</string>
<key>scope</key>
<string>source.js</string>
<key>uuid</key>
<string>CFC8B697-3931-411B-BF75-FDC0807ED1CD</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>$('#theImage').attr('src', 'image.jpg').load(function() {
alert('This Image Has Been Loaded');
});</string>
<key>name</key>
<string>Check if an image has been fully loaded</string>
<key>scope</key>
<string>source.js</string>
<key>uuid</key>
<string>811CE30E-0314-460C-9E7F-603AF406BD85</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>if ($('#someDiv').length) {//hooray!!! it exists...} </string>
<key>name</key>
<string>Check if element exists</string>
<key>scope</key>
<string>source.js</string>
<key>uuid</key>
<string>8C4ABE69-FFEE-4668-A331-E1889913CC09</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>var cloned = $('#somediv').clone();</string>
<key>name</key>
<string>Clone an element</string>
<key>scope</key>
<string>source.js</string>
<key>uuid</key>
<string>0689111A-50CF-495A-B761-E8AC6A60843D</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string> $.expr[':'].mycustomselector = function(element, index, meta, stack){
// element- is a DOM element
// index - the current loop index in stack
// meta - meta data about your selector
// stack - stack of all elements to loop
// Return true to include current element
// Return false to explude current element
};
// Custom Selector usage:
$('.someClasses:test').doSomething();</string>
<key>name</key>
<string>Define a Custom Selector</string>
<key>scope</key>
<string>source.js</string>
<key>uuid</key>
<string>699071CD-5DAE-4DB8-BE7A-4EA67F574383</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>$(”${1:#defList} dd”).click(function(){
window.location=$(this).prev().find(“a”).prop(“href”); return false;
});
/* Add .hover class to the next &lt;dd&gt; when dt is hovered over */
$(’$1 dt’).hover(function() {
$(this).next().addClass(‘hover’).css({‘cursor’ : ‘pointer’});
}, function() {
$(this).next().removeClass(‘hover’);
});
/* Add .hover class to previous &lt;dt&gt; when dd is hovered over */
$(’$1 dd’).hover(function() {
$(this).prev().addClass(‘hover’).css({‘cursor’ : ‘pointer’});
}, function() {
$(this).prev().removeClass(‘hover’);
});
$0</string>
<key>name</key>
<string>Definition List Block Clickable</string>
<key>scope</key>
<string>source.js</string>
<key>uuid</key>
<string>A41A75BB-6745-4698-B719-8A49155561E2</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>function resizeStuff() {
//Time consuming resize stuff here
}
var TO = false;
$(window).resize(function(){
if(TO !== false)
clearTimeout(TO);
TO = setTimeout(resizeStuff, 200); //200 is time in miliseconds
});</string>
<key>name</key>
<string>Delay window.resize event</string>
<key>scope</key>
<string>source.js</string>
<key>uuid</key>
<string>E57815D8-DD51-4535-9BAE-5298470B8000</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>$("#someelement").live('click', function(e) {
if( (!$.browser.msie &amp;&amp; e.button == 0) || ($.browser.msie &amp;&amp; e.button == 1) ) {
alert("Left Mouse Button Clicked");
}
else if(e.button == 2)
alert("Right Mouse Button Clicked");
});</string>
<key>name</key>
<string>Detect Both Right &amp; Left Mouse-clicks with jQuery</string>
<key>scope</key>
<string>source.js</string>
<key>uuid</key>
<string>5902EB6E-7D25-4727-9456-0ECDA89C3A4A</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>Detect Safari (if( $.browser.safari)),
Detect IE6 and over (if ($.browser.msie &amp;&amp; $.browser.version &gt;= 6 )),
Detect IE6 and below (if ($.browser.msie &amp;&amp; $.browser.version &lt;= 6 )),
Detect FireFox 2 and above (if ($.browser.mozilla &amp;&amp; $.browser.version &gt;= '1.8' ))</string>
<key>name</key>
<string>Detect any browser</string>
<key>scope</key>
<string>source.js</string>
<key>uuid</key>
<string>8EF7D595-2A3A-466B-9B8F-F0EA09359B76</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>$(document).bind('contextmenu',function(e){ return false; }); </string>
<key>name</key>
<string>Disable right-click contextual menu</string>
<key>scope</key>
<string>source.js</string>
<key>uuid</key>
<string>36FD2D3F-F774-4E0D-8B4F-0899D2168620</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>//For when an element loses it's focus use .blur()
$('#target').blur(function() {
alert('Handler for .blur() called.');
});
//For when an element gains focus use .focus()
$('#target').focus(function() {
alert('Handler for .focus() called.');
});</string>
<key>name</key>
<string>Focus &amp; Blur functions</string>
<key>scope</key>
<string>source.js</string>
<key>uuid</key>
<string>AFD28F5A-D8E9-44AD-8EDC-8CE012AE9F6F</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>$(document).mousemove(function(e){
$(document).ready(function() {
$().mousemove(function(e){
$(’#XY’).html(”X Axis : ” + e.pageX + ” | Y Axis ” + e.pageY);
});
});</string>
<key>name</key>
<string>Get mouse cursor X and Y</string>
<key>scope</key>
<string>source.js</string>
<key>uuid</key>
<string>AD320984-04CD-4690-B466-DC8FE51EEBAB</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>$("p.value:contains('thetextvalue')").hide(); </string>
<key>name</key>
<string>Hide an element that contains text of a certain value</string>
<key>scope</key>
<string>source.js</string>
<key>uuid</key>
<string>A34E31E9-03FA-465A-9C31-61D5E3B04948</string>
</dict>
</plist>
Loading

0 comments on commit 4e03f1f

Please sign in to comment.