Skip to content

Instantly share code, notes, and snippets.

View jonra1993's full-sized avatar
🎯
Focusing

Jonathan Vargas jonra1993

🎯
Focusing
View GitHub Profile
Library, Description, Link
SQLmodel, It is a , link
@jonra1993
jonra1993 / fastapi_globals.py
Last active March 23, 2023 17:24 — forked from ddanier/fastapi_globals.py
flask.g for FastAPI.
"""
This allows to use global variables inside the FastAPI application using async mode.
# Usage
Just import `g` and then access (set/get) attributes of it:
```python
from your_project.globals import g
const scanner = require('sonarqube-scanner');
scanner(
{
serverUrl: 'http://localhost:9000',
token: "e838dd064de0e78c5c39bcbb23aeb758353944ca",
options: {
'sonar.projectName': 'sonarqube-react-project',
'sonar.projectDescription': 'Here I can add a description of my project',
'sonar.projectKey': 'sonarqube-react-project',
@jonra1993
jonra1993 / sonarqube-server.yml
Last active November 3, 2023 21:31
This is a custom sonarqube container
version: "3.9"
services:
sonarqube:
container_name: "sonarqube-container"
image: "sonarqube:9.9.2-community"
volumes:
- ./sonarqube/extensions:/opt/sonarqube/extensions
- ./sonarqube/logs:/opt/sonarqube/logs
- ./sonarqube/data:/opt/sonarqube/data
import { configureStore } from '@reduxjs/toolkit';
import storage from 'redux-persist/lib/storage'
import { persistStore, persistReducer } from 'redux-persist';
import { encryptTransform } from 'redux-persist-transform-encrypt';
import thunk from 'redux-thunk'
import rootReducer from './rootReducer';
const ENABLE_REDUX_DEV_TOOLS = true;
const encryptor = encryptTransform({
import { configureStore } from '@reduxjs/toolkit';
import storage from 'redux-persist/lib/storage'
import { persistStore, persistReducer } from 'redux-persist';
import thunk from 'redux-thunk'
import rootReducer from './rootReducer';
const ENABLE_REDUX_DEV_TOOLS = true;
const persistConfig = {
key: 'root',
import { combineReducers } from '@reduxjs/toolkit';
import { reducer as counterReducer } from 'src/redux/slices/counter';
const appReducer = combineReducers({
counter: counterReducer,
});
const rootReducer = (state, action) => {
if (action.type === 'RESET_WEBAPP') {
state = undefined;
@jonra1993
jonra1993 / counter.js
Last active March 14, 2021 19:39
counter slice for redux toolkit
import { createSlice } from '@reduxjs/toolkit';
/* STATE */
const initialState = {
counter: 5,
};
const slice = createSlice({
name: 'counter',
initialState,
reducers: {