Skip to content

Instantly share code, notes, and snippets.

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

Sébastien Lorber slorber

🏠
Working from home
View GitHub Profile
@slorber
slorber / generate-docs-from-js.js
Last active April 2, 2024 19:37 — forked from arinthros/generate-docs-from-js
Generate Docusaurus Docs from JSDoc
/**
* Requires jsdoc and jsdoc-to-markdown
*/
/* eslint-disable no-console */
const fs = require('fs')
const path = require('path')
const glob = require('glob')
const { execSync } = require('child_process')
const jsdoc2md = require('jsdoc-to-markdown')
// Logs all calls to preventDefault / stopPropagation in an user-friendly way
if ( process.env.NODE_ENV !== "production" ) {
(function monkeyPatchEventMethods() {
const logEventMethodCall = (event,methodName) => {
const MinimumMeaninfulSelectors = 3; // how much meaningful items we want in log message
const target = event.target;
const selector = (function computeSelector() {
@slorber
slorber / gist:5082320
Created March 4, 2013 13:44
Basic extension / custom SpringBatch support for NewRelic
<?xml version="1.0" encoding="UTF-8"?>
<urn:extension xmlns:urn="newrelic-extension" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="newrelic-extension extension.xsd" name="Custom SpringBatch extension" version="1.0">
<urn:instrumentation metricPrefix="SpringBatch">
<urn:pointcut transactionStartPoint="true" ignoreTransaction="false" excludeFromTransactionTrace="false" metricNameFormat="Job execution">
<urn:className>org.springframework.batch.core.launch.support.SimpleJobLauncher</urn:className>
<urn:method>
<urn:name>run</urn:name>
<urn:parameters>
@slorber
slorber / README.md
Last active January 18, 2023 09:48
React Hebdo 2020

Je teste un système de "petites annonces". Le même Gist sera utilisé sur plusieurs éditions.

Mettez un commentaire:

  • si vous recrutez
  • si vous cherchez un travail ou une mission
  • pour commenter un article
  • pour donner votre avis sur la newsletter
@slorber
slorber / sponsor-this-week-in-react.md
Last active August 31, 2022 17:00
Sponsor This Week In React
@slorber
slorber / react-navigation-tree.jsx
Last active August 13, 2022 19:17
react-navigation-tree.jsx
const App = createAppContainer(
createStack({
LoggedSwitch: createSwitch({
// When user is authenticated
LoggedIn: createStack({
// The logged in root is generally a tab or drawer navigator
LoggedInRoot: createTabsOrDrawer({
@slorber
slorber / test themed image.md
Created May 25, 2022 15:55
test themed image
Shows an illustrated sun in light color mode and a moon with stars in dark color mode.
@slorber
slorber / redux-ecosystem-without-redux.js
Last active December 15, 2020 15:39
Use Redux ecosystem without Redux
////////////////////////////////////////////////////////////////////////
// Intro
///////////////////////
// Tools like Redux-saga, React-redux and Reselect can easily be used without Redux
// For Reselet there's nothing to do, it's just not coupled to Redux
// For the others, you just need to provide an adapter
// At Stample.co we use a legacy framework that is quite close to Redux but with a bad API
// We want to progressively migrate to Redux, so starting now to use Redux tools on new features will make our migration faster
function* runTimer(getState) {
while(yield take('START')) {
while(true) {
const {stop, tick} = yield race({
stop : take('STOP'),
tick : call(wait, ONE_SECOND);
})
if ( !stop ) {
yield put(actions.tick());