Skip to content

Instantly share code, notes, and snippets.

View armetiz's full-sized avatar

Thomas Tourlourat armetiz

View GitHub Profile
-webkit-transform: translateY(10px);
-moz-transform: -moz-translateY(10px);
-ms-transform: -ms-translateY(10px);
-o-transform: -o-translateY(10px);
transform: translateY(10px);
set :application, "wozbe"
set :host, "arthos.armetiz.info"
set :deploy_to, "/var/www/vhosts/com.wozbe.www"
set :app_path, "app"
set :user, "root"
set :repository, "[email protected]:armetiz/wozbe.git"
set :scm, :git
set :model_manager, "doctrine"
<div id="main" class="container">
<div id="header" class="navbar">
<div class="navbar-inner">
<a class="brand" href="#">numerosus</a>
<form class="navbar-search pull-center">
<input type="text" class="search-query" placeholder="Rechercher">
</form>
<ul id="menu" class="nav pull-right">
<li><a href="#">info</a></li>
<li><a href="#">identifiez-vous</a></li>
Template.freeboxes.freeboxes = function () {
return Freeboxes.find();
};
Deps.autorun(function () {
Freeboxes.find();
});
Template.boxes.helpers({
ifHourEnabled: function(conditional, options) {
if(0 !== (conditional & maskHours[this])) {
return options.fn(this);
} else {
return options.inverse(this);
}
}
});
@armetiz
armetiz / gist:5345573
Created April 9, 2013 13:10
Meteor - How to get user IP on server-side
if (Meteor.isServer) {
__meteor_bootstrap__.app.on("request", function(req, res) {
console.log(req.connection.remoteAddress);
});
}
@armetiz
armetiz / gist:5263936
Created March 28, 2013 15:13
ConnectionBundle - QueryBuilder draft
$queryBuilder = $connectionManager->getQueryBuilder();
$destinationConstraints = $queryBuilder->getDestinationConstraints();
$destinationConstraints->getPropertyConstraints()->property('createdAt', QueryBuilderContrainst::greaterThan('23-03-2013'));
$destinationConstraints->getPropertyConstraints()->property('enabled', QueryBuilderContrainst::equals('23-03-2013'));
$destinationConstraints->setType(array('Acme\Models\User', 'Acme\Models\Book'));
$sourceConstraints = $queryBuilder->getSourceContraints();
$sourceConstraints->getPropertyConstraints()->property('createdAt', QueryBuilderContrainst::greaterThan('23-03-2013'));
<?php
namespace Wozbe\AnnonceBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
@armetiz
armetiz / gist:4563971
Created January 18, 2013 11:12
Simple text formatter with name parameter
<?php
class TextBuilder {
private $template;
private $parameters;
public function __construct($template = null, array $parameters = null) {
$this->template = $template;
$this->parameters = $parameters ? $parameters : array();
}
$user = $em->find("Entities\User", $idUser);
$query = $em->createQuery('SELECT messages, responses FROM Entities\Message messages JOIN messages.responses JOIN messages.user user WHERE user.id = :id_user);
$query->setParameter("id_user", $user->getId());
$messages = $query->getResult();
foreach ($messages as $message) {
$responses = $message->getResponses(); //Entities\Message