Skip to content

Instantly share code, notes, and snippets.

View natanfeitosa's full-sized avatar

Natanael dos Santos Feitosa natanfeitosa

View GitHub Profile
# Salvar num arquivo ~/encode.sh, conceder direito de execução e
# executar desta forma (adaptar nomes de diretórios e arquivos para seu caso):
# $ ~/encode.sh ~/Video/bigFile.mp4 ~/Video/smallFile.mp4
ffmpeg -i "$1" -vcodec h264 -acodec aac "$2"
@MasterTuto
MasterTuto / calculator.ts
Created January 4, 2023 23:48
Calculadora em TypeScript
type IncrementTable = {
'0': '1',
'1': '2',
'2': '3',
'3': '4',
'4': '5',
'5': '6',
'6': '7',
'7': '8',
'8': '9',
@ktmud
ktmud / __init__.py
Last active December 21, 2024 23:17
An extreme simple Python http server with auto reload and file-system based router
import os
from .app import start_cli_service
env = (os.environ.get("env") or "prod").lower()
is_dev = env == "dev" or env == "local"
port, autoreload_observer = start_cli_service(autoreload=is_dev)
if autoreload_observer:
# move autoreload observer to the foreground so process won't exit
@Guhan-SenSam
Guhan-SenSam / instructions.md
Last active February 24, 2025 23:41
Creating an AAB for python apps using Buildozer

Introduction

Recently Google made it compulsory that all new apps must be uploaded not as .apk files but as .aab files. Till just recently the tool Buildozer was only able to compile your python applications to .apk but recent changes have allowed us to compile to .aab format. This is an instruction set that can be used to create a release .aab.

What is an AAB

The new .aab format may be a little confusing. .aab stands for app bundles and consists of a bundle of apk's within it. When you upload an aab to the playstore you are basically uploading a bunch of apk. PlayStore then based on the device that is downloading your application will generate the required apk based on that devices architecture and other parameters.

The introduction of .aab doesn't mean that .apk are no longer useful. .aab are only used for releases where as .apk are still used for testing your application and sharing it with others to directly install(not through the store).

> Note: Test your applications

@jengel3
jengel3 / auth.js
Last active April 13, 2023 12:06
Vue/Nuxt JWT Authentication Implementation
// store/auth.js
// reusable aliases for mutations
export const AUTH_MUTATIONS = {
SET_USER: 'SET_USER',
SET_PAYLOAD: 'SET_PAYLOAD',
LOGOUT: 'LOGOUT',
}
export const state = () => ({
from django.db import models
from django.db.models.signals import post_save, post_delete
from django.dispatch import receiver
class Contact(models.Model):
last_name = models.TextField(default='', blank=True)
connections = models.ManyToManyField('self',
through='ContactConnection',
symmetrical=True,
@nilocoelhojunior
nilocoelhojunior / nuxt-breadcrumb.js
Created November 7, 2019 20:37
Breadcrumb to Nuxtjs
<template>
<ol class="breadcrumb">
<li class="item">
<nuxt-link :to="'/'" class="title">
Home
</nuxt-link>
</li>
<li v-for="(item, i) in crumbs" :key="i" class="item">
<nuxt-link :to="item.to" class="title">
{{ item.title }}
@jschaf
jschaf / scratch_server.go
Created March 12, 2019 07:40
A Go web server from scratch using syscalls
package main
// Simple, single-threaded server using system calls instead of the net library.
//
// Omitted features from the go net package:
//
// - TLS
// - Most error checking
// - Only supports bodies that close, no persistent or chunked connections
// - Redirects
@nothingismagick
nothingismagick / caret.js
Last active December 15, 2024 18:17
Small script to detect caret pixel position in contenteditable div
/**
* Get the caret position in all cases
*
* @returns {object} left, top distance in pixels
*/
getCaretTopPoint () {
const sel = document.getSelection()
const r = sel.getRangeAt(0)
let rect
let r2
@fnky
fnky / ANSI.md
Last active October 26, 2025 00:19
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27