Skip to content

Instantly share code, notes, and snippets.

View armetiz's full-sized avatar

Thomas Tourlourat armetiz

View GitHub Profile
<?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: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'));
@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);
});
}
Template.boxes.helpers({
ifHourEnabled: function(conditional, options) {
if(0 !== (conditional & maskHours[this])) {
return options.fn(this);
} else {
return options.inverse(this);
}
}
});
Template.freeboxes.freeboxes = function () {
return Freeboxes.find();
};
Deps.autorun(function () {
Freeboxes.find();
});
<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>
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"
-webkit-transform: translateY(10px);
-moz-transform: -moz-translateY(10px);
-ms-transform: -ms-translateY(10px);
-o-transform: -o-translateY(10px);
transform: translateY(10px);
.boxShadow (...) {
box-shadow: @arguments;
-moz-box-shadow: @arguments;
-webkit-box-shadow: @arguments;
}
.transition (...) {
-webkit-transition: @arguments;
-moz-transition: @arguments;
-o-transition: @arguments;
.transition (...) {
-webkit-transition: @arguments;
-moz-transition: @arguments;
-o-transition: @arguments;
-ms-transition: @arguments;
transition: @arguments;
}
.transitionPerBrowser (@property, @rest...){
-webkit-transition: "-webkit-{@arguments}";