Skip to content

Instantly share code, notes, and snippets.

View ornicar's full-sized avatar
💭
⏚⏚⏚⏚

Thibault Duplessis ornicar

💭
⏚⏚⏚⏚
View GitHub Profile
[
{
"interval": {
"start": 1503100800,
"end": 1503187200
},
"games": {
"bullet": {
"win": 0,
"loss": 1,
CREATE OR REPLACE FUNCTION t_visits_death() RETURNS "trigger" AS $_$
DECLARE
r record;
BEGIN
SELECT INTO r
MAX(t_stamp) AS last_action,
COUNT(pageview_id) > 1 AS interested,
MAX(CASE WHEN p.type = 1 THEN 1 ELSE 0 END) = 1 AS has_product,
EXISTS (SELECT 1 FROM public.carts c WHERE c.visit_id = v.visit_id AND c.total_revenue > 0) AS has_cart,
EXISTS (SELECT 1 FROM public.orders o WHERE o.visit_id = v.visit_id) AS has_order
//onHover sur les videos
$(function() {
$(".video_home").hover(function(){
$(this).find("> a > img").attr("src","") ;
});
});
<div class="video_home" id="1" >
public function editAction($id)
{
$em = $this->getDoctrine()->getEntityManager();
$entity = $em->getRepository('LapaperieFocusBundle:Focus')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Focus entity.');
}
@ornicar
ornicar / .vimrc
Created April 1, 2011 21:01 — forked from marcw/.vimrc
" Insert current namespace and opens php and create empty class, based on the file name
nmap <F9> ggO<?php<CR><CR><ESC>"%PdF/r;:s#/#\\#g<CR>Inamespace <ESC>d/[A-Z]<CR>Goclass <C-R>=expand("%:t:r")<CR><CR>{<CR>
function someSynchronouseCall() {
var data = null;
someAsynchronousCall(function(response) {
data = response.data;
});
// is there some way to wait for the above callback before returning 'data' ?
return data;
}