Skip to content

Instantly share code, notes, and snippets.

View maximiliano's full-sized avatar

Maximiliano Guerra de Medeiros maximiliano

View GitHub Profile
# Git Aliases
## Git - Main
alias g='git'
alias gd='git diff'
alias gs='git status'
alias gb='git branch'
alias gc='git commit'
alias gco='git checkout'
# Create 3 tunnels, each for different ports, with only https enabled
# This way the ngrok process stays bellow the Free plan limit (4 tunnels)
authtoken: ...
log: ngrok.log
tunnels:
first:
addr: 3000
proto: http
bind_tls: true
@maximiliano
maximiliano / tests.py
Last active September 2, 2016 13:07
Parametrized tests
@pytest.fixture(params=('a', 'b', 'c'))
def simple_params(request):
return request.param
def test_params1(simple_params):
assert True is True
# test_params1[a] PASSED
# test_params1[b] PASSED
// first part
(function()
{
window.ext = {};
var MyClass = ext.MyClass = function() {
this.foo = 'bar';
};
MyClass.prototype = {
func1: function() {
...
# FILE models.py
from django.contrib.auth.models import User
from django.db import models
class Profile(models.Model):
user = models.OneToOneField(User)
nome = models.CharField(u'nome', null=True, blank=True, max_length=80)
matricula = models.CharField(u'matricula', null=True, blank=True, max_length=80)
cargo = models.CharField(u'cargo', null=True, blank=True, max_length=80)
@maximiliano
maximiliano / gist:cdeade0ba7d1fb59fc89
Last active August 29, 2015 14:07
Freeswitch call timeout
<!-- Trying to set a timeout on a call -->
<extension name="rule-xxx">
<condition field="destination_number" expression="^xxx$" break="on-true">
<action application="set" data="ringback=${us-ring}"/>
<action application="set" data="transfer_ringback=${us-ring}"/>
<action application="set" data="external_call=true"/>
<action application="set" data="hangup_after_bridge=true"/>
<action application="set" data="continue_on_fail=true"/>
<!-- Prints: EXECUTE sofia/internal/[email protected] log(INFO IGNORE_EARLY_MEDIA: ) -->