Skip to content

Instantly share code, notes, and snippets.

@mTorres
mTorres / silex-php+twig+TwigBrige+translation.php
Created November 4, 2011 18:48
Gist Sample to enable Twig + TwigTranslation bridge to Silex
<?php
require_once __DIR__ . '/../lib/vendor/Silex/silex.phar';
$app = new Silex\Application();
$app['debug'] = true;
// Registering Symfony\Yaml and Symfony\Config
$app['autoloader']->registerNamespace('Symfony', __DIR__.'/../lib/vendor/symfony/src');
<?php
/**
* Before trying this you must need to [create](https://console.developers.google.com/):
* - Google API Secred ID
* - Client secret
* - Also configure the callback point in the console to be this same script
* ([more info](https://developers.google.com/api-client-library/php/start/get_started)
*
* Edit the createGClient function accordingly
@mTorres
mTorres / log-all-never-logged-users.js
Last active October 23, 2017 15:34
Moodle - select all participants without profile image
document.querySelectorAll("img.img-circle")
.forEach(function(el) {
var td = el.parentElement.parentElement;
// Cal mirar si existeix td.nextSibling perquè a més de la taula de participants també hi ha la foto
// del perfil a dalt a la dreta. Segurament es podria millor amb table#participants img.imc-circle, no
// ho he provat, però...
if (td.nextSibling && td.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.innerHTML == "Mai") {
console.log(td.nextSibling.firstChild.firstChild.text);
//console.log(td.nextSibling.firstChild.firstChild.href);