This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Terminal output control (http://www.termsys.demon.co.uk/vtansi.htm) | |
TC='\e[' | |
CLR_LINE_START="${TC}1K" | |
CLR_LINE_END="${TC}K" | |
CLR_LINE="${TC}2K" | |
# Hope no terminal is greater than 1k columns | |
RESET_LINE="${CLR_LINE}${TC}1000D" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo mkdir /mnt/usbdrive | |
sudo mount /dev/sda1 /mnt/usbdrive | |
sudo umount /dev/sda1 | |
OR | |
sudo umount /mnt/usbdrive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# A very crude script to setup debian6-19-04-2012 to use Realtek RRTL8188CUS based Wireless LAN Adapters | |
# Update: 20/05/2012 - It is no longer necessary to edit the script to setup the network SSID & PASSWORD | |
# The script will ask you to input these values when it needs them. | |
# Update: 25/05/2012 - I have added an option to enable the wifi adapter to be hotpluggable. | |
# i.e. you can remove the adapter while the Pi is powered on and then plug it back in later |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JSON.parse(unescape(document.querySelectorAll('embed')[0].attributes.getNamedItem('flashvars').value).substr(7).split('&width')[0]).video_data[0].hd_src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('EMAIL', 'test@example.com'); // edit this | |
define('FLICKR_API_KEY', ''); // edit this | |
define('RAPLEAF_API_KEY', ''); // edit this | |
define('USER_AGENT', 'example user agent (http://www.example.com)'); // edit this | |
define('COOKIE_FILE', '/tmp/cookies.txt'); // edit this if needed | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xsl:key name="myYear" match="/IRXML/NewsReleases/NewsCategory/NewsRelease" use="substring(Date/@Date,1,4)"/> | |
<xsl:template name="yearDropDown"> | |
<xsl:for-each select="/IRXML/NewsReleases/NewsCategory/NewsRelease[generate-id() = generate-id(key('myYear',substring(Date/@Date,1,4))[1])]"> | |
<xsl:sort select="Date/@Date" data-type="text" order="descending" /> | |
<xsl:value-of select="generate-id()"/> | | |
<xsl:value-of select="Date/@Date"/><br /> | |
</xsl:for-each> | |
</xsl:template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function loopnews(){ | |
var $active = jQuery('div.newsTicker>ul>li.active'), | |
$next = $active.next('li'); | |
//console.log($next); | |
if($next.length != 1){ | |
$next = jQuery('div.newsTicker>ul>li:eq(0)') | |
} | |
$active.fadeOut(500,function(){ | |
$active.removeClass('active'); | |
$next.addClass('active').fadeIn(1000,function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(function(){ | |
jQuery('a[href$=".pdf"]').click(function(){ | |
_gat._getTrackerByName()._trackEvent('Download', 'Pdf', this.href); | |
setTimeout('document.location = "' + this.href + '"', 100); | |
return false | |
}); | |
jQuery('a[href$=".exe"]').click(function(){ | |
_gat._getTrackerByName()._trackEvent('Download', 'Exe', this.href); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wbr(str, num) { if(num == undefined) num = 3; | |
return str.replace(RegExp("(\\w{" + num + "})(\\w)", "g"), function(all,text,char){ | |
return text + "<wbr>" + char; | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_.mixin({throttleApi:function(m,g,h,d){var j=function(a){var i=new Date;_.isUndefined(a)||i.setSeconds(i.getSeconds()+a);return i},b=[],e=0,f=0,c=null,l=j(1),k=function(a){console.log("rundo");if(b.length==0)console.log("queue empty".yellow),clearTimeout(c),c=null;else{a=[];if(g){l<j()&&(console.log("reset timer...".yellow),f=0,l=j(1));if(f==g)return;a.push(g-f)}if(h){if(e==h)return;a.push(h-e)}a.push(b.length);a=_.min(a);console.log("i run:"+a);_.times(a,function(){f++;e++;var a=b.shift();_.isUndefined(d)&& | |
(d=_.compact(_.map(a,function(a,b){return _.isFunction(a)?b:!1}))[0]);var c=a[d];a[d]=function(){e--;b.length>0&&_.defer(k);c.apply(this,_.toArray(arguments))};m.apply(null,a)});_.isNull(c)&&b.length>0&&(console.log("setting timer".yellow),c=setInterval(k,500))}};return function(){console.log("pushing args".yellow);b.length==0&&_.defer(k);b.push(_.toArray(arguments))}}}); |
OlderNewer