Skip to content

Instantly share code, notes, and snippets.

View Santosl2's full-sized avatar
🎯
Focusing

Matheus Filype Santosl2

🎯
Focusing
View GitHub Profile
@Santosl2
Santosl2 / keybindings,json
Last active April 28, 2022 03:09
My VSCode Configs
// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "ctrl+d",
"command": "editor.action.copyLinesDownAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+shift+alt+down",
"command": "-editor.action.copyLinesDownAction",
import rootReducer from '../my-rootreducer-dir';

function renderWithRedux(ui, { initialState, store = createStore(rootReducer, initialState) } = {}, renderFn = render) {
  const obj = {
    ...renderFn(<Provider store={store}>{ui}</Provider>),
    store,
  };
  obj.rerenderWithRedux = (el, nextState) => {
@Santosl2
Santosl2 / cache.js
Created February 17, 2023 16:53
Simple Cache Class
export class CacheMap {
private cache: Map<string, Cache>;
private expiration_time: number; // Tempo de expiração em segundos
constructor(expiration?: number) {
this.cache = new Map();
this.expiration_time = expiration || 60;
}
# migrating from https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/git/git.plugin.zsh
# Aliases
alias g='git'
#compdef g=git
alias gst='git status'
#compdef _git gst=git-status
alias gd='git diff'
#compdef _git gd=git-diff
alias gdc='git diff --cached'
@Santosl2
Santosl2 / .bashrc
Last active July 1, 2025 19:41
Fish and Bash Aliases
## Carrega automaticamente o .nvmrc
load-nvmrc() {
local nvmrc_path
nvmrc_path="$(nvm_find_nvmrc)"
if [ -n "$nvmrc_path" ]; then
local nvmrc_node_version
nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
if [ "$nvmrc_node_version" = "N/A" ]; then
@Santosl2
Santosl2 / catch-figma-colors.js
Created March 22, 2024 23:52
A simple algorithm to catch all figma libraries colors
const exportedColors = [{}];
const colorsTitle = document.querySelectorAll(
"div.raw_components--modalPanel--NX71G.variable_picker_ui--modalPanel--X0bjl > div > div > div > div"
);
Array.from(colorsTitle).map((el) => {
const color = el.textContent;
if (!color) return;
@Santosl2
Santosl2 / plugin.tpl
Last active October 8, 2024 23:55
gtm-webhook
___INFO___
{
"type": "MACRO",
"id": "cvt_temp_public_id",
"version": 1,
"securityGroups": [],
"displayName": "Conversor para Webhook | Matheus Filype",
"description": "",
"containerContexts": [
@Santosl2
Santosl2 / cookie.js
Created June 30, 2024 17:45
GTM Create Cookie JS function
@Santosl2
Santosl2 / install.md
Last active August 12, 2024 01:40
Comando de instalação docker e etc

Docker

 sudo apt-get update
 sudo apt install docker.io
 sudo systemctl enable docker
 sudo usermod -aG docker $USER

Docker compose

@Santosl2
Santosl2 / Formatter.ts
Last active February 24, 2025 13:38
Regex
class Formatters {
static hour(value: string) {
if (!value) return value
const formatter = value
.replace(/\D/g, '')
.replace(/(\d{2})(\d)/, '$1:$2')
.replace(/(\d{2}):(\d{2}).+/, '$1:$2')
return formatter