Skip to content

Instantly share code, notes, and snippets.

View Slashgear's full-sized avatar
🏠
Working from home

Antoine Caron Slashgear

🏠
Working from home
View GitHub Profile
@Slashgear
Slashgear / Dojo.md
Last active July 8, 2025 19:04
LyonJS #106 Coding Dojo

Exercice 1 : Créer un triangle avec des étoiles 🌟

Objectif

Concevoir une fonction en JavaScript qui génère un triangle d'étoiles dans la console en fonction d'un nombre donné en paramètre.


Consignes

  1. Écris une fonction appelée generateTriangle qui prend un paramètre :
  • n : un entier positif (représente le nombre de lignes du triangle).
@Slashgear
Slashgear / TESTS.md
Created January 16, 2025 13:35
Test strategy description (Standard proposal)

TESTS

Stability

/**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const t=window,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),i=new WeakMap;class r{constructor(t,e,i){if(this._$cssResult$=!0,i!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=i.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&i.set(s,t))}return t}toString(){return this.cssText}}const o=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,s,i)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[i+1]),t[0]);return new r(i,t,s)},n=
@Slashgear
Slashgear / README.md
Last active November 12, 2021 14:52
Bedrock React evaluation - Remotion

Bedrock Remotion trailer

Duration: 1hour => 1hour 20minutes interview

Subject: React, autonomy test

Subject

The objective of this workshop is to generate a video using React and the Remotion library. The video is available in appendix.

const { ApolloServer, gql } = require("apollo-server");
const { RESTDataSource } = require("apollo-datasource-rest");
const typeDefs = gql`
type Book {
url: String
name: String
isbn: String
authors: [String]
numberOfPages: Int
const test = require('ava');
const sum = require('./sum');
test('sum', async t => {
t.is(sum(2,3), 5);
});
function sum(a, b) {
return a + b;
}
module.exports = sum;
language: node_js
node_js:
- '12'
cache:
yarn: true
directories:
- public
- .cache
script:
- yarn build
@Slashgear
Slashgear / LazyImage.js
Last active March 27, 2019 17:58
LastStep
import React, { useState, useEffect } from "react";
import styled from "styled-components";
const placeHolder =
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkqAcAAIUAgUW0RjgAAAAASUVORK5CYII=";
const Image = styled.img`
display: block;
height: 100px;
width: 100px;
@Slashgear
Slashgear / LazyImage.js
Last active March 27, 2019 17:56
Intersection Observer trick
import React, { useState, useEffect } from "react";
import styled from "styled-components";
const Image = styled.img`
display: block;
height: 100px;
width: 100px;
`;
const placeHolder =