Skip to content

Instantly share code, notes, and snippets.

@yobud
yobud / routines.js
Last active September 19, 2020 01:09
À lancer en console depuis la page https://alexa.amazon.fr/api/behaviors/automations
let humanReadable = {
'Volet Cuisine': 'volet de la cuisine',
'Volet Salon': 'volet du salon',
'Volet Salle à manger': 'volet de la salle à manger',
'Volets Pièce à vivre': 'volets de la pièce à vivre',
'Volet Chambre de Léo': 'volet de la chambre de Léo',
'Volet Chambre': 'volet de la chambre'
};
// Delete all routines
// This mixin adds inset property to the original mixin which can be found here :
// https://github.com/msadouni/compass-css-arrow/blob/master/stylesheets/compass-css-arrow/_css-arrow.scss
// Default Settings
$arrow-default-position : bottom !default;
$arrow-default-size : 1em !default;
$arrow-default-color : gray !default;
$arrow-default-border-width : 0 !default;
$arrow-default-border-color : false !default;
$arrow-default-border-style : solid !default;
@yobud
yobud / presence.dao.php
Created May 22, 2013 13:15
Best code ever (please keep in mind i'm not the author)
if (0 && $last->date == '20120126') {
Tools::print_r2($regr);
}
{# Ton form de base, celui qui va contenir ta collection de steps #}
{% form_theme form "TonBundle:Dossier:step_form_theme.html.twig" %}
<form gangnagna>
{{ form_errors(form) }}
...
{{ form_widget(form.steps) }}
...
<div>
<button type="submi">
{% block collection_widget %}
{% set attr = attr|merge({'data-prototype': block('prototype')|trim }) %}
{{ block('collection_rows')|replace({'\n':''})|raw }}
{% endblock %}
{% block prototype %}
{% if prototype is defined %}
{% include 'IfgmSTVBundle:Category:_translationPrototype.html.twig' %}
{% endif %}
{% endblock %}
{% line 9 %}{% block collection_rows %}
- block collection_widget
- set attr = attr|merge({'data-prototype': block('prototype')|trim })
= block('collection_rows')|replace({'\n':''})|raw
- block prototype
- if prototype is defined
- include 'IfgmSTVBundle:Category:_translationPrototype.html.haml'
- block collection_rows
- spaceless
@yobud
yobud / rock3tvid4tampermonkey.js
Created April 23, 2013 11:21
Automagically process to watch video on rock3tvid.com using rock3tvid extension Tampermonkey script for rock3tvid.com chrome extension (may also work with firefox / greasemoney with maybe some modifications)
// ==UserScript==
// @name Rock3tvid immediate reading
// @version 1.0
// @description Automagically process to watch video on rock3tvid.com using rock3tvid extension
// @match http://www.rock3tvid.com/watch?v=*
// @copyright 2013+, Jérémy Hubert <jeremy.hubert@infogroom.fr>
// @require http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js
// ==/UserScript==
$(function() {
public function load(array $configs, ContainerBuilder $container)
{
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.yml');
$config = array();
foreach ($configs as $subConfig) {
$config = array_merge($config, $subConfig);
}
$(function() {
$('p').each(function() {
var indent = 10; // pixel indent
var lineHeight = 14;
var nblines = $(this).height()/lineHeight;
$(this).width($(this).width()+nblines*indent);
for(var i=0; i < nblines; i++) {
$(this).prepend("<div style='float:right; clear:both; width:"+(i*indent)+"px; height: "+lineHeight+"px;'></div><div style='float:left; width:"+((nblines-i)*indent)+"px; height: "+lineHeight+"px;'></div>");
}
});
@yobud
yobud / AddFulltextIndexesCommand.php
Created September 22, 2011 09:35
MATCH AGAINST for Doctrine DQL queries
<?php
# xxx/yyyBundle/Command/AddFulltextIndexesCommand.php
/**
* AddFulltextIndexesCommand.php
*
* @author Jérémy Hubert <jeremy.hubert@infogroom.fr>
* @since lun. 26 sept. 2011 09:23:53
*/
namespace xxx\yyyBundle\Command;