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
# Will remove all .mp3 files starting in current directory and will search in each folder | |
find . -name '._*' -exec rm -f {} \; |
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
<script type="text/javascript"> | |
function loadVideoInfo(ID) { | |
var i = 1; | |
return $.getJSON('http://gdata.youtube.com/feeds/api/videos/'+ID+'?v=2&alt=jsonc',function(data,status,xhr){ | |
var template,thumbnail,nome,ul; | |
thumbnail = data.data.thumbnail.hqDefault; | |
nome = data.data.title; | |
if( i%5 === 0 ) { |
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 | |
# Componente para Upload e Downlload de arquivos. | |
class ArquivoComponent extends Component | |
{ | |
public function extensao($arquivoNome) | |
{ | |
$extencao = explode('.', $arquivoNome); | |
$extencao = end($extencao); |
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
<script defer="defer" type="text/javascript"> | |
window.onload=function(){ | |
var mycode; | |
mycode=document.createElement("script"); | |
mycode.type="text/javascript"; | |
mycode.src="<?php bloginfo('template_url') ?>/js/your_script.js"; | |
document.getElementsByTagName("head")[0].appendChild(mycode); | |
} | |
</script> |
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
j=1 | |
for i in *.jpg; | |
do | |
mv "$i" "$j.jpg"; | |
((j++)) | |
done |
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
// https://github.com/ajaxorg/node-github | |
var GitHubApi = require("github"); | |
var github = new GitHubApi({ | |
version: "3.0.0" | |
}); | |
github.gists.getFromUser({ | |
user: "hugodias" | |
}, function(err, res) { | |
console.log(JSON.stringify(res)); |
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
public function slufigy($string) | |
{ | |
$table = array( | |
'Š'=>'S', 'š'=>'s', 'Đ'=>'Dj', 'đ'=>'dj', 'Ž'=>'Z', 'ž'=>'z', 'Č'=>'C', 'č'=>'c', 'Ć'=>'C', 'ć'=>'c', | |
'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', 'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E', | |
'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I', 'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O', | |
'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U', 'Ú'=>'U', 'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'Ss', | |
'à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a', 'å'=>'a', 'æ'=>'a', 'ç'=>'c', 'è'=>'e', 'é'=>'e', | |
'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 'î'=>'i', 'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ò'=>'o', 'ó'=>'o', | |
'ô'=>'o', 'õ'=>'o', 'ö'=>'o', 'ø'=>'o', 'ù'=>'u', 'ú'=>'u', 'û'=>'u', 'ý'=>'y', 'ý'=>'y', 'þ'=>'b', |
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 | |
// AppController.php | |
class AppController extends Controller { | |
// ... | |
} | |
// AppUsersController.php | |
class AppUsersController extends AppController { | |
public function funcaoTeste(){ | |
// ... |
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
$(document).ready(function() { | |
// Apenas dias a partir do dia atual poderão ser escolhidos | |
var dateMin = new Date(); | |
// Função para bloquear finais de semana e segunda-feira | |
function noWeekendsOrMondays(date) { | |
var day = date.getDay(); | |
// Remove finais de semana do calendário |
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
var availableDates = ["9-5-2011","14-5-2011","15-5-2011"]; | |
function available(date) { | |
dmy = date.getDate() + "-" + (date.getMonth()+1) + "-" + date.getFullYear(); | |
console.log(dmy+' : '+($.inArray(dmy, availableDates))); | |
if ($.inArray(dmy, availableDates) != -1) { | |
return [true, "","Available"]; | |
} else { | |
return [false,"","unAvailable"]; | |
} |