Skip to content

Instantly share code, notes, and snippets.

View raymag's full-sized avatar
Learning something new everyday

C. Magno raymag

Learning something new everyday
View GitHub Profile
@raymag
raymag / syncer.py
Created April 26, 2024 16:58
Syncs up video and music cutting up at strong beats.
import os
import shutil
import subprocess
import ffmpeg
import librosa
import numpy as np
import time
def extract_peaks(y, sr):
@raymag
raymag / cam_to_ascii.py
Created March 17, 2024 03:38
Transforms video from webcam into a real-time ascii art
import math
import cv2 as cv
import numpy as np
import sys
import pygame
gscale1 = "$@B%8&WM#*oahkbdpqwmZO0QLCJUYXzcvunxrjft/\|()1{}[]?-_+~<>i!lI;:,\"`'. "[::-1]
thresholds = [x * 5 for x in range(70)]
@raymag
raymag / Question.js
Created August 8, 2020 20:59
API Quiz Question Model with Images
const mongoose = require('mongoose')
const QuestionSchema = new mongoose.Schema({
description: String,
image: {
type: String,
required: false
},
alternatives: [
{
@raymag
raymag / routes.js
Created August 8, 2020 20:58
API Quiz create and update questions
// create one quiz question
router.post('/questions', async (req, res) => {
try {
const { description } = req.body
const { image } = req.body
const { alternatives } = req.body
const question = await Question.create({
description,
alternatives,