Skip to content

Instantly share code, notes, and snippets.

View hartym's full-sized avatar
👽
Crafting great software

Romain Dorgueil hartym

👽
Crafting great software
View GitHub Profile
[alias]
co = checkout
ci = commit
br = branch
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
st = status
[color]
branch = auto
diff = auto
interactive = auto
python -c 'import random; print(random.randint(pow(10,3),int(2*pow(10,8)/365)))' 'Gare du Nord'
# Orignal version taken from http://www.djangosnippets.org/snippets/186/
# Original author: udfalkso
# Modified by: Shwagroo Team and Gun.io
import sys
import os
import re
import hotshot, hotshot.stats
import tempfile
import StringIO
@hartym
hartym / designer.html
Created August 24, 2014 20:03
designer
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../topeka-elements/category-icons.html">
<link rel="import" href="../core-icon/core-icon.html">
<polymer-element name="my-element">
<template>
<style>
<?php
echo '<pre>';
print_r(sfContext::getInstance()->getUser()->getAttributeHolder()->getAll());
echo '</pre>';
die();
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
FileETag none
<IfModule mod_headers.c>
Header set Expires "Thu, 15 Apr 2015 20:00:00 GMT"
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "modification plus 10 years"
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
FileETag none
<IfModule mod_headers.c>
Header set Expires "Thu, 15 Apr 2015 20:00:00 GMT"
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "modification plus 10 years"
<?php
class myForm extends sfFormDoctrine
{
public function processValues($values = null)
{
$values = parent::processValues($values);
// calculate the value of virtual field "foo"
$values['foo'] = $foo;
return $values;
$result = $this
->createQuery('r')
->select('r.*, e.*')
->from('BookingResource r')
->leftJoin(
'r.Entries e ON '.
'( ( e.ending_at > :start AND e.ending_at <= :end ) OR '.
' ( e.starting_at < :end AND e.starting_at >= :start ) OR '.
' ( e.starting_at < :start AND e.ending_at > :end ) )'
)
// WITH SPACE: BUGGY
$result = $this
->createQuery('r')
->select('r.*, e.*')
->from('BookingResource r')
->leftJoin(
'r.Entries e ON '.
'( r.id = e.resource_id AND '.
'( ( e.ending_at > :start AND e.ending_at <= :end ) OR '.