Skip to content

Instantly share code, notes, and snippets.

Sergio Vilar sergiovilar

Block or report user

Report or block sergiovilar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View teste.js
var clickOpen = function (x,y,z) {
$('.'+x).click(function(){
$('.'+y).addClass(z);
});
};
clickOpen ('class01', 'class02', 'class03');
View questao.js
// Funções utilitárias
var readline = require('readline');
function ler(pergunta, callback){
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
View file.html
<span class="date">{$templateconf.txtadded} {$item.DateDisplay[0]}</span>
<span class="year"></span>
<span class="day"></span>
<span class="month"></span>
@sergiovilar
sergiovilar / RestController.php
Last active Aug 29, 2015
Criando uma API REST com CakePHP
View RestController.php
<?php
/**
* Created by PhpStorm.
* User: sergiovilar
* Date: 05/04/14
* Time: 11:44 PM
*/
class RestController extends AppController{
View arquivo.js
livros = [
// Titulo
{
titulo: 'Teste 1'
},
{
titulo: 'Teste 2'
}
];
View main.pp
# Define o path
Exec { path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" ] }
# apt
exec { 'apt-get update':
command => 'apt-get update',
timeout => 60,
tries => 3
}
View subscription.js
/*
* @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({
View functions.php
<?php
foreach($app->imovel->find() as $post){
echo $post->title ."<br />";
echo $post->date('d/m/Y')."<br />";
}
View teste.php
<?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>
View CarModel.php
<?php
class CarModel extends AppModel{
public $fields = array(
// Default Wordpress Fields
'title' => true,
'editor'=> true,
'thumbnail' => true,
You can’t perform that action at this time.