Skip to content

Instantly share code, notes, and snippets.

View Toilal's full-sized avatar

Rémi Alvergnat Toilal

View GitHub Profile
@Toilal
Toilal / gist:7303463
Created November 4, 2013 14:42
Traceback of Test memory input caching
======================================================================
ERROR: Test memory input caching
----------------------------------------------------------------------
Traceback (most recent call last):
File "D:\devel\workspace\Flexget\lib\site-packages\nose\case.py", line 197, in runTest
self.test(*self.arg)
File "D:\devel\workspace\Flexget\tests\__init__.py", line 192, in wrapper
return func(*args, **kwargs)
File "D:\devel\workspace\Flexget\tests\test_cached_input.py", line 42, in test_memory_cache
task.execute()
@Toilal
Toilal / pootle
Last active October 11, 2017 07:31
init.d script for Pootle
#! /bin/sh -e
### BEGIN INIT INFO
# Provides: pootle
# Required-Start: $apache2
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Pootle
# Description: Get your community translating your software into their languages.
### END INIT INFO
Dans Git 2.0 Git utilisera par défaut le comportement plus conservatif 'simple'
qui ne pousse la branche courante vers la branche distante que 'git pull' utilise
pour mettre à jour la branche courante.
@Toilal
Toilal / gist:5871680f0e5f2fa54412
Last active August 29, 2015 14:07
angular-gantt TimeFrames Proposal
// timeFrames defines named ranges of hours in a day.
// Each timeFrame can be marked as working or non-working, and have a css class attached.
var timeFrames = {
'day': {'start': '09:00', 'end': '18:00', 'working': true, 'css-class': 'gantt-range-day'},
'noon': {'start': '12:00', 'end': '13:30', 'working': false, 'css-class': 'gantt-range-noon'},
'morning': {'start': '09:00', 'end': '12:00', 'working': true, 'css-class': 'gantt-range-morning'},
'afternoon': {'start': '13:30', 'end': '18:00', 'working': true, 'css-class': 'gantt-range-afternoon'},
'closed': {'working': false, 'css-class': 'closed'} // If no start nor end is defined, consider this as full day.
};
import org.fluentlenium.configuration.ConfigurationException;
import org.fluentlenium.configuration.WebDriverFactory;
import org.openqa.selenium.Capabilities;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.Augmenter;
import org.openqa.selenium.remote.RemoteWebDriver;
import java.net.MalformedURLException;
import java.net.URL;
import org.fluentlenium.configuration.ConfigurationException;
import org.fluentlenium.configuration.WebDriverFactory;
import org.openqa.selenium.Capabilities;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.Augmenter;
import org.openqa.selenium.remote.RemoteWebDriver;
import java.net.MalformedURLException;
import java.net.URL;
import graphene
from sqlalchemy.inspection import inspect
from graphene.types.utils import yank_fields_from_attrs
from graphene.types.objecttype import ObjectTypeOptions
from graphene_sqlalchemy import get_session
from graphene_sqlalchemy.registry import get_global_registry
from graphene_sqlalchemy.types import construct_fields
@Toilal
Toilal / api.module.ts
Last active February 21, 2023 10:30
@auth0/angular2-jwt Authorization Service and HttpInterceptor supporting JWT Refresh Token (Angular 4.3+ & 5+)
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { JWT_OPTIONS, JwtInterceptor, JwtModule } from '@auth0/angular-jwt';
import { AuthorizationService } from './authorization.service';
import { environment } from '../../environments/environment';
import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
import { RefreshTokenInterceptor } from './refresh-token-interceptor';
function jwtOptionsFactory (authorizationService: AuthorizationService) {
return {
@Toilal
Toilal / gist:521e0ceded0b9f4c3b4c9ecc70f4bb24
Created November 19, 2020 14:15
Il faudrait parfois envisager de changer de métier ...
public List<DoublonPP> findNombreDoublonPP(boolean nomPatronymique,
boolean prenom, boolean dateNaissance, boolean telephoneDomicile,
boolean telephonePortable, boolean rue, boolean codePostal) {
if (!nomPatronymique && !prenom && !dateNaissance && !telephoneDomicile
&& !telephonePortable && !rue && !codePostal) {
return null;
}
try {
StringBuilder queryString = new StringBuilder();
public List<DoublonPP> findNombreDoublonPP(boolean nomPatronymique,
boolean prenom, boolean dateNaissance, boolean telephoneDomicile,
boolean telephonePortable, boolean rue, boolean codePostal) {
if (!nomPatronymique && !prenom && !dateNaissance && !telephoneDomicile
&& !telephonePortable && !rue && !codePostal) {
return null;
}
try {
StringBuilder queryString = new StringBuilder();