Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View sergiopvilar's full-sized avatar

Sergio Vilar sergiopvilar

View GitHub Profile
var clickOpen = function (x,y,z) {
$('.'+x).click(function(){
$('.'+y).addClass(z);
});
};
clickOpen ('class01', 'class02', 'class03');
// Funções utilitárias
var readline = require('readline');
function ler(pergunta, callback){
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
<span class="date">{$templateconf.txtadded} {$item.DateDisplay[0]}</span>
<span class="year"></span>
<span class="day"></span>
<span class="month"></span>
@sergiopvilar
sergiopvilar / RestController.php
Last active August 29, 2015 13:58
Criando uma API REST com CakePHP
<?php
/**
* Created by PhpStorm.
* User: sergiovilar
* Date: 05/04/14
* Time: 11:44 PM
*/
class RestController extends AppController{
livros = [
// Titulo
{
titulo: 'Teste 1'
},
{
titulo: 'Teste 2'
}
];
# Define o path
Exec { path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" ] }
# apt
exec { 'apt-get update':
command => 'apt-get update',
timeout => 60,
tries => 3
}
/*
* @Author: sergiovilar
* @Date: 2014-03-18 15:10:07
* @Last Modified by: sergiovilar
* @Last Modified time: 2014-04-21 23:31:05
*/
subscriptions_created = false;
App.Model.Subscription = Backbone.Model.extend({
<?php
foreach($app->imovel->find() as $post){
echo $post->title ."<br />";
echo $post->date('d/m/Y')."<br />";
}
<?php foreach($app->destaque->find() as $destaque): ?>
<article class="slide" style="background-image: url('<?=$imovel->thumbnail->full?>')">
<div class="container">
<?php get_template_part('category', 'nav'); ?>
<hgroup class="group col-md-7">
<h1><a href="<?=$destaque->link?>" title="<?=$destaque->title?>"><?=$destaque->title?></a></h1>
<h2><a href="<?=$destaque->link?>" title="<?=$destaque->subtitulo?>"><?=$destaque->subtitulo?></a></h2>
</hgroup>
</div>
</article>
<?php
foreach($app->car->find() as $car):
echo $car->title;
endforeach;