Skip to content

Instantly share code, notes, and snippets.

View decko's full-sized avatar

André "decko" de Brito decko

View GitHub Profile
@contraexemplo
contraexemplo / pulseaudio-noise-cancelling.md
Last active October 20, 2023 18:15
Como ativar o módulo de cancelamento de ruído do PulseAudio

Primeiro, verifique se o módulo está presente na sua instalação digitando pacmd em seu terminal, listando todos os módulos presentes pelo comando list-modules e procurando por module-echo-cancel. Não está presente? Você precisa adicionar algumas linhas ao arquivo de texto responsável pela configuração do PulseAudio.

Com o seu editor favorito, abra (com privilégios de administrador) o arquivo /etc/pulse/default.pa e adicione as seguintes linhas ao fim do arquivo:

### Enable Echo/Noise-Cancellation
load-module module-echo-cancel use_master_format=1 aec_method=webrtc aec_args="analog_gain_control=0\ digital_gain_control=1" source_name=echoCancel_source sink_name=echoCancel_sink
set-default-source echoCancel_source
set-default-sink echoCancel_sink
This is a basic example of using SOCKS.
From the computer you want to browse on you'll make an ssh connection to the computer you want to browse from.
In this example it'll be my laptop connecting to my desktop.
Run: ssh -D <port, I use 10000> <user>@<hostname of desktop>
Now, in a browser you don't normally use (I'm using firefox), go to network proxy.
Set Manual porxy configuration
@victorcarrico
victorcarrico / test_image_upload.py
Last active January 18, 2017 01:28
Django REST Framework - Testing image upload
import tempfile
from PIL import Image
class PhotoCreateAPIViewTest(TestCase):
def setUp(self):
super().setUp()
self.tmp_file = tempfile.NamedTemporaryFile(suffix='.jpg')
image = Image.new('RGB', (100, 100))
library(rgdal)
library(dplyr)
library(ggmap)
library(RColorBrewer)
library(classInt)
gpclibPermit()
votacao <- read.csv("~/devel/eleicoes2016/raw/eleicao2012/votacao_candidato_munzona_2012_SP.csv", sep=";", quote="\"", header = FALSE, fileEncoding="cp1252")
eleitos <- votacao %>%
@ryanpager
ryanpager / practical-application-branding-angular.md
Last active August 22, 2016 03:55
Practical Application Branding 101 -- AngularJS & ngMaterial Magic

Practical Application Branding 101

Fun with AngularJS & ngMaterial [ Ionic Optional ]

Branding is one of the more important aspects of business to business application development. In specific, nothing is more powerful then walking into a business meeting with a client whom you are trying to sell you application to; then showing them a completely redesigned application -- specifically the way they would want it to look (their assets, logos, color pallete, etc). Whether its a mobile app (iOS, Android, whatever), or desktop application -- personalizing an application can make the difference between landing a deal versus having the client walk out the door. It makes it "their" experience rather than your own.

While branding isn't necessarily used and/or useful for every application -- I believe a great deal of applications can benefit from basic branding. After all, "branding" is just another way of saying "personalization"...and who doesn't like to personalize an application to their tastes.

anonymous
anonymous / tmux.conf
Created September 9, 2014 18:35
vim friendly tmux configuration
#Prefix is Ctrl-a
set -g prefix C-a
bind C-a send-prefix
unbind C-b
set -sg escape-time 1
set -g base-index 1
setw -g pane-base-index 1
#Mouse works as expected
@willemarcel
willemarcel / gist:a07917d21b7f3cce92da
Last active September 5, 2019 10:25
Running Django apps with nginx and uwsgi

How to configure nginx and uwsgi to serve a Django application

Install

You need to install nginx, uwsgi and uwsgi-plugin-python (or uwsgi-plugin-python3)

Create nginx files

Create /etc/nginx/sites-available/project and create a link to it in /etc/nginx/sites-enabled/project

@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active May 14, 2025 09:43
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@js1568
js1568 / L.TopoJSON.js
Last active August 29, 2015 13:57 — forked from rclark/L.TopoJSON.js
/*
You'll need something like this in your HTML:
<script src="http://d3js.org/topojson.v1.min.js"></script>
*/
L.TopoJSON = L.GeoJSON.extend({
addData: function(jsonData) {
if (jsonData.type === "Topology") {
for (key in jsonData.objects) {
geojson = topojson.feature(jsonData, jsonData.objects[key]);
class Tag(models.Model):
name = models.CharField(u'Tag', max_length=100)
post = models.ForeignKey(Post, related_name='tags')
slug = models.SlugField(u'Slug')
def get_absolute_url(self):
return reverse('posts.views.tag', kwargs={'slug': self.slug})
def __unicode__(self):
return unicode(self.name)