Skip to content

Instantly share code, notes, and snippets.

View nicolascb's full-sized avatar
🇵🇸
Working from home

Nicolas Barbosa nicolascb

🇵🇸
Working from home
View GitHub Profile
@nicolascb
nicolascb / aab.md
Created March 12, 2025 01:41 — forked from chirag-chhajed/aab.md
Expo APK/AAB Building Tutorial (No EAS Required)

Here's the list with the additional points:

  1. Ensure that you have OpenJDK 17, Android Studio, and its associated tools and NDK (Native Development Kit) installed on your system.

  2. Initialize a new Expo project by executing the following command in your terminal: pnpm create expo-app@latest. This command will prompt you to provide some details about your project, such as the project name and configuration options.

  3. Before building the Android app, you need to prebuild the android directory. Run the command pnpm expo prebuild to generate the necessary files. Additionally, you should provide your app's package name during this step. For example, if your app's package name is com.example.app.

  4. Generate a keystore file. Use an administrator shell to create the keystore. Run the following command: keytool -genkeypair -v -storetype PKCS12 -keystore my-upload-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000 and enter your password (store it safely somewhere) and details.

Keybase proof

I hereby claim:

  • I am nicolascb on github.
  • I am ncbdev (https://keybase.io/ncbdev) on keybase.
  • I have a public key ASCUZX23bnBo8WKG_c6xr28YvyGFbiZ1MBErXKE84go3sAo

To claim this, I am signing this object:

func Test_IsPrimeHandler(t *testing.T) {
handler := setupMux()
type args struct {
req *http.Request
}
tests := []struct {
name string
args func(t *testing.T) args
const (
apiAddress = ":8081"
)
func main() {
mux := setupMux()
http.ListenAndServe(apiAddress, mux)
}
func setupMux() *http.ServeMux {
func Test_IsPrimeHandler(t *testing.T) {
handler := setupMux()
type args struct {
req *http.Request
}
tests := []struct {
name string
args func(t *testing.T) args
@nicolascb
nicolascb / bgtoggle.vim
Created November 14, 2021 01:04
vim: background toggle
let s:darkmode = 0
function! BgToggle()
if s:darkmode
execute 'set background=light'
execute 'colorscheme base16-atelier-dune-light'
execute 'AirlineTheme base16_atelier_dune_light'
let s:darkmode = 0
return
endif
@nicolascb
nicolascb / harden.sh
Created August 10, 2021 14:36 — forked from B1zzy1/harden.sh
hardening script for an alpine docker container
#!/bin/sh
set -x
set -e
#
# Docker build calls this script to harden the image during build.
#
# NOTE: To build on CircleCI, you must take care to keep the `find`
# command out of the /proc filesystem to avoid errors like:
#
# find: /proc/tty/driver: Permission denied
@nicolascb
nicolascb / hexdec.go
Created March 6, 2019 12:18
hexdec — Hexadecimal to decimal
func hexdec(s string) uint64 {
d := uint64(0)
for i := 0; i < len(s); i++ {
x := uint64(s[i])
if x >= 'a' {
x -= 'a' - 'A'
}
d1 := x - '0'
if d1 > 9 {
d1 = 10 + d1 - ('A' - '0')
@nicolascb
nicolascb / main.go
Created April 23, 2018 12:04 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@nicolascb
nicolascb / groupbyday-timestamp.sql
Created March 8, 2018 12:30
SQLITE: Contar linhar agrupando por dia formatando unixtimestamp.
select strftime("%Y-%m-%d",datetime(createdate,'unixepoch')),count(*) as total from calls where pendente=1 group by strftime("%Y-%m-%d",datetime(createdate,'unixepoch'))