Skip to content

Instantly share code, notes, and snippets.

View abcsds's full-sized avatar

Alberto Barradas abcsds

View GitHub Profile
@abcsds
abcsds / pdc_dtf.py
Created September 28, 2023 09:03 — forked from agramfort/pdc_dtf.py
Partial Directed Coherence and Direct Transfer Function using MVAR processes
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Implements Partial Directed Coherence and Direct Transfer Function
using MVAR processes.
Reference
---------
Luiz A. Baccala and Koichi Sameshima. Partial directed coherence:
a new concept in neural structure determination.
@abcsds
abcsds / vidstab_ffmpeg.md
Created July 6, 2023 06:46 — forked from hlorand/vidstab_ffmpeg.md
Video stabilization using VidStab and FFMPEG

Video stabilization using VidStab and FFMPEG

** Step 1 **

Install ffmpeg with the vidstab plugin.

@abcsds
abcsds / pygame.py
Created December 23, 2013 08:56
Pygame basic class structure
import pygame
from pygame.locals import *
class Game(object):
"""docstring for Game"""
def __init__(self,arg):
self.arg = arg
self.fullscreen = False
img = pygame.image.load('image.png')
@abcsds
abcsds / Latex in Markdown.md
Created February 3, 2022 16:45
A quick way to render latex in markdown
@abcsds
abcsds / lucasKanade.jl
Created October 10, 2018 09:28
Lucas-Kanade method on julia
using Images
# FFTW.set_num_threads(2)
"""
opticalFlow(im1::Array, im2::Array, kps::Array{CartesianIndex{2},1}; windowSize=15)
Parameters:
- im1: An Image array, the first frame in time.
- im2: The second frame in time, must be the same size as im1
- kps: Key points, or points of interest within the image where the optical flow is expected.
- windowSize: Window size for solving the flow equations. Default 15.
"""
@abcsds
abcsds / main.jl
Created August 2, 2018 04:59
[LSTM language Model] a simple example that creates a character-based language model with LSTMs in Julia with the help of Flux
using Flux
using Flux: onehot, argmax, chunk, batchseq, throttle, crossentropy
using StatsBase: wsample
using Base.Iterators: partition
cd(@__DIR__)
text = collect(repeat(readstring("prince_eo.txt"), 20))
alphabet = [unique(text)..., '_']
text = map(ch -> onehot(ch, alphabet), text)
@abcsds
abcsds / serial.jl
Last active May 12, 2018 08:11
Small snippet to open a serial connection from Julia.
using SerialPorts
s = SerialPort("/dev/ttyACM1", 250000)
write(s, "Hello World!\n")
close(s)
@abcsds
abcsds / Maracuyá.md
Created March 16, 2016 18:31
Receta para licor de maracuyá

Licor de maracuyá

  1. Calculen cuánto maracuyá quieren usar. Digamos que usan 2 kg de maracuyá para este ejemplo. (Pesados con todo y cáscara)
  2. Los abren y les sacan todo el contenido (chequen que no estén agusanados) y lo colocan en un recipiente
  3. Licúan la pulpa de manera que se suelten las semillas, o sea en la velocidad mínima y por nó más de un minuto. (No quieren trozarlas todas y tener licor de semilla).
  4. Lo cuelan todo para quitarle las semillas. Esto toma un rato y hay que estarle moviendo porque la pulpa atasca la coladera.
  5. Una vez colado, una o dos veces le agregan aguardiente en una cantidad igual a la mitad del peso original del maracuyá en litros (2kg * 0.5 = 1lt de aguardiente. El aguardiente lo pueden conseguir en alguna mezcalería en el centro o de plano en una licorería. No gasten más de 100 pesos en eso, por muy caro y que no tenga ya sabor, que sea natural; de caña puede ser)
  6. Lo revuelven bien un ratillo
  7. Lo ponen en un recipiente (yo diría que de vidrio) en total osc
@abcsds
abcsds / pygame2exe.py
Created December 23, 2013 09:03
Personal pygame2exe
# This will create a dist directory containing the executable file, all the data
# directories. All Libraries will be bundled in executable file.
#
# Run the build process by entering 'pygame2exe.py' or
# 'python pygame2exe.py' in a console prompt.
#
# To build exe, python, pygame, and py2exe have to be installed. After
# building exe none of this libraries are needed.
#Please Note have a backup file in a different directory as if it crashes you
#will loose it all!(I lost 6 months of work because I did not do this)
@abcsds
abcsds / infb.py
Created November 14, 2017 06:46 — forked from meznak/infb.py
A script to scrape information from your facebook friends.
#!/usr/bin/python
'''
InFB - Information Facebook
Usage: infb.py user@domain.tld password
infb.py
http://ruel.me