Skip to content

Instantly share code, notes, and snippets.

View silvioramalho's full-sized avatar
😀
Always coding...

Silvio Ramalho silvioramalho

😀
Always coding...
View GitHub Profile
@silvioramalho
silvioramalho / deploydotnetcoreheroku.md
Last active May 13, 2020 19:39
Deploy .net core to Heroku

Deploy .net core to Heroku

Steps:

  1. Create Dockerfile on solution root
  2. Add .dockerignore
  3. Include code below to Program.cs
      public static IHostBuilder CreateHostBuilder(string[] args) =>
@silvioramalho
silvioramalho / react-native-authentication.md
Last active September 21, 2025 17:55
Creating React Native Authentication

Creating React Native Authentication

Creating a complete authentication flow using context-api. (Step-by-step)

This flow can be replicated to React-JS (Web)

Creating App

npx react-native init reactNativeAuth --template react-native-template-typescript

@silvioramalho
silvioramalho / error-xcconfig -unable-open-file.md
Created May 16, 2020 21:05
Fix erro: ProjectName.debug.xcconfig unable to open file

Error: Fix error: ProjectName.debug.xcconfig unable to open file

error: projectName/Pods/Pods...ProjectName.debug.xcconfig unable to open file

pod deintegrate
pod install
@silvioramalho
silvioramalho / certificates.md
Created May 19, 2020 11:23
Prepare certificates to Apple Push Notification Service

Prepare certificates to Apple Push Notification Service

Convert .P12

openssl pkcs12 -nocerts -out PushChatKey.pem -in push-service.p12

Convert CER

openssl x509 -in aps.cer -inform der -out PushChatCert_prod.pem

@silvioramalho
silvioramalho / qrcode-generate.py
Created June 10, 2020 20:53
QrCode Generator
# CS50x
# Generates a QR code
# https://github.com/lincolnloop/python-qrcode
import qrcode
# Generate QR code
img = qrcode.make("https://www.redologic.com.br")
# Save as file
@silvioramalho
silvioramalho / mic-voice-recognize.py
Created June 10, 2020 20:54
Microphone voice recognize
# CS50x
# Recognizes a voice
# https://pypi.org/project/SpeechRecognition/
import speech_recognition
# Obtain audio from the microphone
recognizer = speech_recognition.Recognizer()
with speech_recognition.Microphone() as source:
print("Say something!")
# CS50x
# Responds to a name
# https://pypi.org/project/SpeechRecognition/
import re
import speech_recognition
# Obtain audio from the microphone
recognizer = speech_recognition.Recognizer()
with speech_recognition.Microphone() as source:
@silvioramalho
silvioramalho / identify-draw-face.py
Created June 10, 2020 20:56
Identify and draw box on person
# CS50x
# Identify and draw box on person
# https://github.com/ageitgey/face_recognition/blob/master/examples/identify_and_draw_boxes_on_faces.py
import face_recognition
import numpy as np
from PIL import Image, ImageDraw
# Load a sample picture and learn how to recognize it.
known_image = face_recognition.load_image_file("malan.jpg")
# CS50x
# Find faces in picture
# https://github.com/ageitgey/face_recognition/blob/master/examples/find_faces_in_picture.py
from PIL import Image
import face_recognition
# Load the jpg file into a numpy array
image = face_recognition.load_image_file("yale.jpg")
@silvioramalho
silvioramalho / ffmpeg-samples.md
Last active June 10, 2020 23:37
Manipulating Audio and Video

Manipulating Audio and Video

https://ffmpeg.org/

Verify there is silence at the end

ffmpeg -i audio.wav -af silencedetect=n=-50dB:d=0.5 -f null - 2>&1 | grep -Eo "silence_(start|end)" | tail -n 1 | grep "start" | wc -l