View gist:f6298e5e593c7615f74687a5823ac1d6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) install eslint-plugin-unused-imports | |
`yarn add -D eslint-plugin-unused-imports` | |
2) add "unused-imports" to your "plugins"section under .eslitrc.json file | |
``` | |
"plugins": [ | |
"react", | |
"@typescript-eslint", |
View wrapper.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { configureStore, Store } from '@reduxjs/toolkit'; | |
import React, { ComponentType, ReactElement } from 'react'; | |
import { Provider } from 'react-redux'; | |
import { createMemoryHistory } from 'history'; | |
import { Router } from 'react-router'; | |
import { reducer } from '../state/store'; | |
export const makeStore = (): Store => configureStore({ reducer }); | |
const history = createMemoryHistory(); |
View factory.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person { | |
firstName = 'John'; | |
lastName = 'Doe'; | |
} | |
class Factory { | |
create<T>(type: (new () => T)): T { | |
return new type(); | |
} | |
} |
View gist:3c3513fa6b36022a22c9b732822b44c4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git grep "string/regexp" $(git rev-list --all) | |
or filtering every commit and only show branches | |
git grep "your-search" `git show-ref --heads` or git show-ref --heads | xargs git grep "your-search" | |
View docker-compose.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.2" | |
services: | |
rabbitmq: | |
image: rabbitmq:3-management-alpine | |
container_name: 'rabbitmq' | |
environment: | |
RABBITMQ_ERLANG_COOKIE: "SWQOKODSQALRPCLNMEQG" | |
RABBITMQ_DEFAULT_USER: "rabbitmq" | |
RABBITMQ_DEFAULT_PASS: "rabbitmq" | |
RABBITMQ_DEFAULT_VHOST: "/" |
View partition.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function partition(input, step,pad){ | |
const output = []; | |
for (let i = 0; i < input.length; i += pad){ | |
const part = input.slice(i, i + step) | |
if(part.length >=step ) | |
output[output.length] = part | |
} | |
return output; |
View elliot.ps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//@version=1 | |
//@Author: cocodrino | |
//This indicator was made to allow three moving averages to be displayed without needing to use up 3 charting indicators individually | |
// based on https://elitecurrensea.com/education/wave-mystery-solved-via-simple-methods-based-on-fibs-and-mas/ | |
study(title="MA Elliot Helpers", shorttitle="Melliot", overlay=true) | |
View hook.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//=======LOGIN LOGOUT IN MENU | |
add_filter( 'wp_nav_menu_items', 'ia_custom_menu_item', 10, 2 ); | |
function ia_custom_menu_item ( $items, $args ) { | |
//var_dump($args); | |
if (is_user_logged_in()) { | |
$items .= '<li id="menu-item-logout" class="menu-item menu-item-type-custom menu-item-object-custom aiv_sign_button"><a href="/mi-cuenta/salir/">Salir</a></li>'; |
View index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {createStore} from 'redux' | |
import rootReducer from './reducers' | |
import {Provider} from 'react-redux' | |
const store = createStore( | |
rootReducer, | |
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__() | |
) | |
ReactDOM.render(<Provider store={store}><App /></Provider>, document.getElementById('root')); |
View index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {createStore} from 'redux' | |
import rootReducer from './reducers' | |
import {Provider} from 'react-redux' | |
const store = createStore( | |
rootReducer, | |
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__() | |
) | |
ReactDOM.render(<Provider store={store}><App /></Provider>, document.getElementById('root')); |
NewerOlder