Skip to content

Instantly share code, notes, and snippets.

View julestruong's full-sized avatar
🎯
Focusing

Jules T julestruong

🎯
Focusing
  • BackMarket
  • Paris
  • 04:03 (UTC +02:00)
View GitHub Profile
<body style="height: 100%; margin: 0; -webkit-text-size-adjust: none; font-family: &quot;Nunito Sans&quot;, Helvetica, Arial, sans-serif; background-color: #FFFFFF; color: #333333; width: 100% !important;">
<table class="email-wrapper" width="100%" cellpadding="0" cellspacing="0" role="presentation" style="width: 100%; margin: 0; padding: 0; -premailer-width: 100%; -premailer-cellpadding: 0; -premailer-cellspacing: 0;">
<tbody><tr>
<td align="center" style="font-family: &quot;Nunito Sans&quot;, Helvetica, Arial, sans-serif; font-size: 16px;">
<table class="email-content" width="100%" cellpadding="0" cellspacing="0" role="presentation" style="width: 100%; margin: 0; padding: 0; -premailer-width: 100%; -premailer-cellpadding: 0; -premailer-cellspacing: 0;">
<tbody><tr>
<td class="email-masthead" style="font-family: &quot;Nunito Sans&quot;, Helvetica, Arial, sans-serif; font-size: 16px; padding: 35px 0 5px; text-align: center;">
<a hre
import { loadPackage } from '@nestjs/common/utils/load-package.util';
import { transformSchema } from '@nestjs/graphql';
import { BuildFederatedSchemaOptions } from '@nestjs/graphql';
import { GraphQLSchema, isObjectType, buildASTSchema } from 'graphql';
import { forEach } from 'lodash';
export function buildMercuriusFederatedSchema({
typeDefs,
resolvers,
}: BuildFederatedSchemaOptions) {
@julestruong
julestruong / sql
Created May 24, 2019 16:19
offers moderated more than once
SELECT
COUNT(count) nb_remoderation,
month
FROM
(
SELECT count(1) count,
DATE_FORMAT(logged_at, '%Y-%m') month
FROM office_offer oo
INNER JOIN office_offer_log log ON log.object_id = oo.id
WHERE JSON_CONTAINS(log.data, '"moderation"', '$.state')
@julestruong
julestruong / gist:c98b8e4ac1705822739dabb8b7bd35db
Created May 24, 2019 16:18
offers nb moderation by month
SELECT
COUNT(count),
month
FROM
(SELECT COUNT(1) count, DATE_FORMAT(logged_at, '%Y-%m') month
FROM office_offer oo
INNER JOIN office_offer_log log ON log.object_id = oo.id
WHERE JSON_CONTAINS(log.data, '"moderation"', '$.state')
GROUP BY oo.id, month
) sub
@julestruong
julestruong / authent.ts
Created June 1, 2018 17:26
Groupama Authent bug
async function validateCredentials(request: any) {
const logClient = console;
// Always Trace the Lambda event and context
logClient.log(`request : [${JSON.stringify(request)}]`);
const body = (request.body && JSON.parse(request.body)) || undefined;
// Check that the received body contains the required informations
// For security reasons do not return a menaingfull message to the caller