Skip to content

Instantly share code, notes, and snippets.

View arruda's full-sized avatar

Felipe Arruda Pontes arruda

View GitHub Profile
@ragnraok
ragnraok / iframe-probe.py
Created September 9, 2019 07:24 — forked from alastairmccormack/iframe-probe.py
Shows GOP structure for video file using ffmpeg --show-frames output
#!/usr/bin/env python
#
# Shows GOP structure of video file. Useful for checking suitability for HLS and DASH packaging.
# Example:
#
# $ iframe-probe.py myvideo.mp4
# GOP: IPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP 60 CLOSED
# GOP: IPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP 60 CLOSED
# GOP: IPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP 60 CLOSED
# GOP: IPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP 60 CLOSED
@navenduagarwal
navenduagarwal / dummyimage.py
Created June 14, 2018 06:09
python script to create dummy image via opencv
import cv2
import numpy as np
def create_blank(width, height, rgb_color=(0, 0, 0)):
"""Create new image(numpy array) filled with certain color in RGB"""
# Create black blank image
image = np.zeros((height, width, 3), np.uint8)
# Since OpenCV uses BGR, convert the color first
@henfiber
henfiber / KB-Buying-guide-EU.md
Last active May 3, 2024 06:38
Buying keyboards and keyboard components from EU

Europe

  • SkinFlint : Price comparison site which has some nice filtering options per switch type etc. Searches for offers in UK, Germany, Poland and Austria
  • mykeyboard.eu : Keyboards, keycaps and accessories. Based in Belgium.
  • candykeys.com : European Store selling Vortex, Leopold, KBP, Anne Pro keyboards, keycap sets and components (ISO + ANSI). Based in Germany, ships to EU.
  • falba.tech : custom wooden bamboo cases, and some acrylic and carbon ones. Switch packs (65 browns at 48EUR). Other parts for the GH60, Atreus, ErgoDox. Also Microcontrollers, diodes, leds etc.
  • 42keebs.eu - Mostly PCBs, tools and accessories. Located in Czech Republic.
  • KEYGEM : Switches, Keycaps, lubes, cables, DIY kits and deskmats. Based in Germany, ships to the EU and worldwide.
  • [Eloquent Clicks - Custom Mechanical Keyboard Store](https://www.eloquen
@fbidu
fbidu / mimimi.py
Last active August 10, 2018 02:21
def mimimi(frase):
"""
Função que mimimiza frases
>>> mimimi('Por que você não tá estudando pra sua prova de amanhã?')
'Pir qii vici nii ti istidindi pri sii privi di iminhi?'
"""
n = ('ã', 'a', 'e', 'o', 'u', 'á', 'é', 'ê', 'í', 'ó')
for letra in n:
frase = frase.replace(letra, 'i')
return frase

The steps below will get you up and running with a local development environment.

First, we must install a C/C++ compiler and some necessary libraries to compile some python modules that have extensions written in C.

The requirements.apt the file contains a list of non python libraries necessary to run this project. The script install_os_dependencies.sh help you to install these libraries.

Note

The names of the packages listed in the file requirements.apt were specifically tested on Ubuntu 14.04 64bit. Package names may change from version to version of Ubuntu.

@arruda
arruda / fig.yml
Created January 26, 2015 16:21
Fig with PG
db:
image: postgres:9.3
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
volumes:
- /var/lib/postgresql/data
ports:
- "5432:5432"
@Nagyman
Nagyman / workflows-in-django.md
Last active January 27, 2024 08:29
Workflows in Django

Workflows (States) in Django

I'm going to cover a simple, but effective, utility for managing state and transitions (aka workflow). We often need to store the state (status) of a model and it should only be in one state at a time.

Common Software Uses

  • Publishing (Draft->Approved->Published->Expired->Deleted)
@dan-blanchard
dan-blanchard / .1.miniconda.md
Last active December 11, 2019 22:38
Quicker Travis builds that rely on numpy and scipy using Miniconda

For ETS's SKLL project, we found out the hard way that Travis-CI's support for numpy and scipy is pretty abysmal. There are pre-installed versions of numpy for some versions of Python, but those are seriously out of date, and scipy is not there are at all. The two most popular approaches for working around this are to (1) build everything from scratch, or (2) use apt-get to install more recent (but still out of date) versions of numpy and scipy. Both of these approaches lead to longer build times, and with the second approach, you still don't have the most recent versions of anything. To circumvent these issues, we've switched to using Miniconda (Anaconda's lightweight cousin) to install everything.

A template for installing a simple Python package that relies on numpy and scipy using Miniconda is provided below. Since it's a common s

@vbmendes
vbmendes / sublpymodule.py
Created April 3, 2013 17:42
Script to open source code of python modules in sublime. Useful to see your dependencies source code.
#!/usr/bin/env python
# coding: utf8
import imp
import sys, os
module_name = sys.argv[1]
bits = module_name.split('.')
name = imp.find_module(bits[0])[1]
if len(bits) > 1:
django-admin.py startproject --template=https://github.com/githubuser/dj_project_templates/blob/master/project_template.tar --extension="md,py" myproject