Skip to content

Instantly share code, notes, and snippets.

View edinella's full-sized avatar
🐝
“Nothing will work unless you do.” — Maya Angelou

Ezequias Dinella edinella

🐝
“Nothing will work unless you do.” — Maya Angelou
View GitHub Profile
# 1. Crie a branch de correção e troque para ela
git checkout -b fix/whatever
# 2. Faça as alterações, veja as diferenças, adicione e confirme
git diff
git add .
git commit -m "fix: corrige problema XYZ"
# 3. Envie a branch para o remoto e defina o upstream
git push -u origin fix/whatever

O banco de dados do histórico fica em ~/Library/Application Support/Arc/User Data/Default/History

Abrir com https://sqlitebrowser.org

Query para sumarizar períodos:

SELECT 
 datetime(min(v.visit_time)/1000000 - 11644473600, 'unixepoch', '-3 hours') AS start_time,
email.normalize("NFD").replace(/[\u0300-\u036f]/g, "")
@edinella
edinella / ObjectId and Pydantic.py
Last active February 19, 2025 18:51
How Pydantic can handle `id` as string and `_id` as ObjectId for PyMongo
from typing import List, Optional
from bson import ObjectId
from pydantic import BaseModel, Field
class PyObjectId(ObjectId):
@classmethod
def __get_validators__(cls):
yield cls.validate
@edinella
edinella / .bash_profile
Created February 23, 2019 04:16 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
#! /bin/bash
if [ -z "$1" ] || [ -z "$2" ]; then
printf "Use BRANCH and ALIAS as arguments. Ex:\n"
printf "./deploy.sh develop tangerine\n"
exit 1
fi
GITBRANCH=$1
ALIAS=$2
@edinella
edinella / textLike.js
Created November 26, 2015 16:27
MongoDB Query similar to SQL "LIKE"
module.exports = function textLike(str) {
var escaped = str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
return new RegExp(escaped, 'i');
};
// Forked from kaushikgopal/.phoenix.js
// Released under MIT license - http://opensource.org/licenses/MIT
var BROWSER;
var EDITOR;
var FINDER;
var GRID_HEIGHT;
var GRID_WIDTH;
var MARGIN_X;
var MARGIN_Y;
// request context
function Context(reqArgs, entity) {
this.req = reqArgs.req;
this.res = reqArgs.res;
this.next = reqArgs.next;
this.entity = entity;
}
Context.prototype.handleErrors = function(fn) {
var context = this;
@edinella
edinella / kill_process_on_port.sh
Last active February 7, 2024 19:48
Error: listen EADDRINUSE: address already in use
sudo kill $(sudo lsof -t -i:8080)