Skip to content

Instantly share code, notes, and snippets.

@thibaut-d
thibaut-d / docker-compose.yml
Last active May 22, 2025 03:18
wordpress docker-compose.yml with Redis and Traefik
version: '3'
networks:
# enable connection with Traefik
traefik:
external: true
# network for the app
backend:
services:
@thibaut-d
thibaut-d / 00 - React Native CLI Cheatsheet.sh
Last active June 21, 2020 21:12
React Native CheatSheet
# Start With TypeScript
npx react-native init AwesomeTSProject --template react-native-template-typescript
# Run the app locally
npx react-native start
npx react-native run-android
npx react-native run-ios
@thibaut-d
thibaut-d / ReactNativeFonctionalComponent.tsx
Created September 16, 2020 13:40
Basic functional component for React Native with TypeScript
import React, { FC } from 'react'
import { StyleSheet, Text, View } from 'react-native'
interface Props {
/** prop1 documentation */
prop1: string
}
/**
* Component description
@thibaut-d
thibaut-d / ReactNativeFunctionalComponentWithState.tsx
Created September 16, 2020 13:52
React Native functional component with internal state management
import React, { FC, useEffect, useState } from 'react'
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native'
interface Props {
/** prop documentation */
restart?: number
}
/**
* Component description
@thibaut-d
thibaut-d / CustomHookContext.tsx
Last active September 16, 2020 14:03
Shared state management with React Native and the Context API
import React, { createContext, FC } from 'react'
import useCustomHook, { UseCustomHookType, initialCustomHookContext } from './useCustomHook'
// Props type
interface Props {
/** Children components place, shall not be needed here with FC type, yet eslint requires it... */
children: React.ReactNode
}
// Create the context objects
@thibaut-d
thibaut-d / ScreenName.tsx
Last active September 16, 2020 14:10
React Navigator's StackNavigator and a screen
import React, { useEffect, useState, useContext, FC } from 'react'
import { StyleSheet, SafeAreaView, FlatList } from 'react-native'
import { StackNavigationProp } from '@react-navigation/stack'
import { RouteProp } from '@react-navigation/native'
import { HomeScreenStackParamList } from '../navigation/navigationTypes'
interface Props {
navigation: StackNavigationProp<ScreenNameStackParamList, 'Home'>
route: RouteProp<ScreenNameStackParamList, 'Home'>
}
@thibaut-d
thibaut-d / gitflow-cheatsheet.md
Last active November 6, 2020 20:03
Gitflow cheatsheet (without the Gitflow extension)
sudo apt-get update -y
sudo apt-get install -y python3-pip git-all awscli
sudo pip3 install flask jupyter boto3
sudo pip3 install --upgrade awscli
cd /home/ubuntu
jupyter notebook --ip=0.0.0.0 --port=8888 --allow-root
library(tidyverse)
library(textshape)
library(lexicon)
library(textclean)
library(hunspell)
library(qdapRegex)
#' Detect and correct misspells in a string
#' @param x string.
#' @return corrected string
@thibaut-d
thibaut-d / linux.md
Last active January 5, 2022 16:05
Memo

Memo

Download a directory with scp

scp -r [email protected]:/home/thibaut/project backups/project

Run in background

nohup python myscript.py &