Skip to content

Instantly share code, notes, and snippets.

View sinsunsan's full-sized avatar

Sébastien LUCAS sinsunsan

View GitHub Profile
{
"data": {
"query": {
"c_nature": "0",
"c_artist": "0",
"c_interm": "0",
"c_devise": "1"
},
"type": "years",
"series": [
@sinsunsan
sinsunsan / chatgpt-preprompt-06-12-2024
Created December 6, 2023 15:32
You are ChatGPT, a large language model trained by OpenAI, based on the GPT-4 architecture.
You are ChatGPT, a large language model trained by OpenAI, based on the GPT-4 architecture.
####
Knowledge cutoff: 2023-04
Current date: 2023-12-06
Image input capabilities: Enabled
# Tools
@sinsunsan
sinsunsan / .stylerc.json
Created February 4, 2020 10:16
Default style lint config
{
"extends": "stylelint-config-recommended-scss",
"rules": {
"selector-pseudo-element-no-unknown": [
true,
{
"ignorePseudoElements": [
"ng-deep"
]
}
tdLines.forEach((line, index) => {
switch (true) {
// you can use any condition here
case this.isLineNotReadyToUse(line):
linesNotReadyToUseCount++;
break;
case this.isPartNumberDuplicated(line, index, tdLines):
duplicatedPartsCount++;
break;
case partNumberAssociatedData &&
@sinsunsan
sinsunsan / alternative-switch.js
Created August 5, 2019 13:28
alternative switch not evaluating the value of switched variable
lines.forEach((line, index) => {
switch (true) {
// the this.isACondition return true and will be evaluated o not otherwise won't be
case this.isACondition(line):
doSomething++;
break;
case this.isAnOtherCondition(line):
doElseThing++;
break;
case this.somethingElseThatReturnTrueOrFalse(line, index):
import { Component } from '@angular/core';
import { ICellRendererAngularComp } from 'ag-grid-angular/main';
import { ICellRendererParamsExtended } from '../../../models/i-cell-renderer-params-extended.model';
@Component({
selector: 'gfec-simple-list',
templateUrl: './select-cell-renderer.component.html',
styleUrls: ['./select-cell-renderer.component.scss'],
})
@sinsunsan
sinsunsan / typescript-function.types.ts
Created July 12, 2018 13:48
add function types with typescript
/**
* Hide a column if the column field
* belongs to applicability hidden by default columns
*/
processLeaf(
colDef: ColDef,
columnsSelection: string[],
leafProcess: (visible: boolean, colDef: ColDef) => ColDef
) {
let colDefChanged: ColDef;
@sinsunsan
sinsunsan / my visual studio settings.js
Last active July 12, 2018 12:36
visual studio updated
{
"gitlens.advanced.messages": {
"suppressShowKeyBindingsNotice": true
},
"editor.minimap.enabled": false,
"window.zoomLevel": 0,
"editor.wordWrap": "on",
"explorer.confirmDragAndDrop": false,
"gitlens.advanced.messages": {
"suppressShowKeyBindingsNotice": true
@sinsunsan
sinsunsan / gist:218896b4ea0351a357286f3c45382fb5
Created May 17, 2018 09:40
visual-studio-code.user-settings
{
"editor.formatOnSave": true,
"editor.tabSize": 2,
"sasslint.enable": true,
"editor.minimap.enabled": false,
"explorer.confirmDragAndDrop": false,
"window.zoomLevel": 0,
"editor.wordWrap": "on",
}
@sinsunsan
sinsunsan / deduplications-of-arrays-in-js.js
Created April 20, 2018 09:56
deduplication of Arrays in js without lodash
// we concatenate projects thanks to the spread operator of ES6
const allProjects = [
...projectsB,
...projectsA
];
// we use the new Set object
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set