This file contains hidden or 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 in_array (needle, haystack) | |
{ | |
for (var key in haystack) | |
if (haystack[key] == needle) | |
return true; | |
return false; | |
} | |
var initOnline = AvailableList.getOnlineIDs(); |
This file contains hidden or 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 | |
function time_ago($date, $granularity=1) | |
{ | |
$date = strtotime($date); | |
if (!$date) return ''; | |
$difference = time() - $date; | |
$periods = array( | |
'decad' => 315360000, | |
'ann' => 31536000, | |
'mes' => 2628000, |
This file contains hidden or 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 | |
/usr/local/mysql/bin/mysqldump --add-drop-database -h $1 -u $2 -p $5 > /tmp/dump.sql; mysql -h $3 -u $4 -p $5 < /tmp/dump.sql; |
This file contains hidden or 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
Date.prototype.timeAgoString = function(granularity) | |
{ | |
var t = this.timeAgo(granularity); | |
var r = []; | |
for (var i=0; i<t.length; i++) | |
r.push( t[i].time+' '+t[i].key ); | |
return r.join(' e '); | |
} | |
Date.prototype.timeAgo = function(granularity) |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" id="jquery-script"></script> | |
<script type="text/javascript" src="https://raw.github.com/kopiro/kopiroTimeAgo/master/kopiro.timeago.js"></script> | |
<script type="text/javascript"> | |
jQuery(document).ready(function($){ | |
$('time').kopiroTimeAgo({ granularity:5 }); | |
}); | |
</script> |
This file contains hidden or 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
[].forEach(document.querySelectorAll('.fbFeedTickerStory'), function(t) { | |
t.innerHTML += '<i>'+(new Date(t.dataset['ticker-timestamp']*1000).toTimeString().match(/[0-9][0-9]\:[0-9][0-9]\:[0-9][0-9]/))+'</i>'; | |
}); |
This file contains hidden or 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
var jq = document.createElement('script'); | |
jq.src = '//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js'; | |
document.body.appendChild(jq); | |
var jqI = setInterval(function() | |
{ | |
if (!jQuery in window) return; | |
clearInterval(jqI); | |
jQuery.noConflict(); | |
window.$J = jQuery; |
This file contains hidden or 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
AsyncRequest.prototype.sendOriginal = AsyncRequest.prototype.send; | |
AsyncRequest.prototype.send = function(ka){ | |
if ( this.uri.path.match('typ|read_status|mark_seen')) return; | |
this.sendOriginal(ka); | |
} |
This file contains hidden or 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/sh | |
cur=$(cat current); | |
serie=$(echo $cur | awk -F"x" '{print $1}'); | |
episode=$(echo $cur | awk -F"x" '{print $2}'); | |
if ! [[ "$serie" =~ ^[0-9]+$ ]]; then | |
echo "Unmatched serie, exit"; | |
exit; |