Skip to content

Instantly share code, notes, and snippets.

View HallexCosta's full-sized avatar
:octocat:
Learning on-demand!

Hállex da Silva Costa HallexCosta

:octocat:
Learning on-demand!
View GitHub Profile
@HallexCosta
HallexCosta / settings.json
Created December 9, 2020 22:22
Permission Denied to Move or Rename Folders
// settings
// To solve this problem add the following line of code in the settings.json file in vscode
files.watcherExclude": {
"**/**/*": true
}
}
@HallexCosta
HallexCosta / guid.ts
Created January 24, 2021 02:35
Generate Unique Id (ObjectId)
export function guid(): string {
const date = new Date()
const timestamp = ((date.getTime() / 1000) | 0).toString(16)
const context = `${timestamp}xxxxxxxxxxxxxxxx`
const hash = context
.replace(/[x]/g, () => ((Math.random() * 16) | 0).toString(16))
.toLowerCase()
return hash
}
@HallexCosta
HallexCosta / .cz-config.js
Last active April 11, 2025 12:49
Configs for commitzen customizable
'use strict';
module.exports = {
types: [
{value: 'feat', name: 'feat: A new feature'},
{value: 'fix', name: 'fix: A bug fix'},
{value: 'docs', name: 'docs: Documentation only changes'},
{value: 'style', name: 'style: Changes that do not affect the meaning of the code\n (white-space, formatting, missing semi-colons, etc)'},
{value: 'refactor', name: 'refactor: A code change that neither fixes a bug nor adds a feature'},
@HallexCosta
HallexCosta / Either.ts
Last active February 5, 2021 18:52
Error Pattern with Either
export type Either<L, A> = Left<L, A> | Right<L, A>
export class Left<L, A> {
readonly value: L
constructor (value: L) {
this.value = value
}
isLeft (): this is Left<L, A> {
@HallexCosta
HallexCosta / shortcutkeys.txt
Created February 7, 2021 06:08
Tmux shortcut keys
Ctrl+b c Create a new window (with shell)
Ctrl+b w Choose window from a list
Ctrl+b 0 Switch to window 0 (by number )
Ctrl+b , Rename the current window
Ctrl+b % Split current pane horizontally into two panes
Ctrl+b " Split current pane vertically into two panes
Ctrl+b o Go to the next pane
Ctrl+b ; Toggle between the current and previous pane
Ctrl+b x Close the current pane
@HallexCosta
HallexCosta / tmux-cheatsheet.markdown
Created February 9, 2021 16:27 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@HallexCosta
HallexCosta / profiles.json
Created February 11, 2021 13:51 — forked from joshtynjala/profiles.json
Ayu color schemes for Windows Terminal
{
"schemes" :
[
{
"background" : "#fafafa",
"black" : "#000000",
"blue" : "#3199e1",
"brightBlack" : "#686868",
"brightBlue" : "#399ee6",
"brightCyan" : "#4cbf99",
@HallexCosta
HallexCosta / fix-tmux-terminal-overrides-bugs.md
Last active May 5, 2021 05:06
How to active 256 color in Tmux with Neovim
# Init a new instance tmux
$ tmux

# Override xterm-256color:Tc for active true colors of TMUX
$ tmux set-option -ga terminal-overrides ",xterm-256color:Tc"

# Disconnect of session (without exit)
$ tmux detach
@HallexCosta
HallexCosta / README.md
Last active December 21, 2021 19:08
Ayu Theme for wsltty/mintty
  • Ayu Mirage Dark
  • Ayu Mirage Light
  • Ayu Dark
  • Ayu Light

Ayu Mirage Dark ayu-mirage-dark

Ayu Mirage Light ayu-mirage-light

@HallexCosta
HallexCosta / Merge.php
Last active March 4, 2021 21:12
MergeSort Algorithm with PHP
<?php
/**
* class Merge
*/
class Merge {
/**
* sort
* @param array &$a (Pointer)
* @param int $lb