Skip to content

Instantly share code, notes, and snippets.

@juandebravo
juandebravo / gist:1082939
Created July 14, 2011 17:24
trazas_webapi
2011-07-14 17:16:53.714 DEBUG [udp/0.0.0.0/5060-t-4] #SIP#: (i)[INVITE sip:index.json@tropo-dev90.tropo-dev90 SIP/2.0\r\nContent-Type: application/sdp\r\nTo: <sip:index.json@tropo-dev90.tropo-dev90>\r\nVia: SIP/2.0/UDP 192.168.1.116:59832;rport;branch=z9hG4bKPjQPJYgGNYZRrsn0zowshB6.reEGvej7Bh\r\nAllow: SUBSCRIBE, NOTIFY, PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, MESSAGE, REFER\r\nCSeq: 32187 INVITE\r\nContent-Length: 365\r\nSupported: 100rel, norefersub\r\nCall-ID: TuKcF7lHPjTeOF5EGFCcd6LRj6qx6Mxy\r\nUser-Agent: Blink 0.24.0 (MacOSX)\r\nFrom: "usera" <sip:usera@tropo-dev90>;tag=0C53ZuMSLfhNJgJI5W7FnQGftDs4UEDW\r\nMax-Forwards: 70\r\nContact: <sip:zsudcpij@3.3.3.11:59832>\r\n\r\nv=0\r\no=- 3519652669 3519652669 IN IP4 3.3.3.11\r\ns=Blink 0.24.0 (MacOSX)\r\nc=IN IP4 3.3.3.11\r\nt=0 0\r\nm=audio 50054 RTP/AVP 9 104 103 102 0 8 101\r\na=rtcp:50055\r\na=rtpmap:9 G722/8000\r\na=rtpmap:104 speex/32000\r\na=rtpmap:103 speex/16000\r\na=rtpmap:102 speex/8000\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:10
A SUCCESSFUL GIT BRANCHING MODEL
- http://nvie.com/posts/a-successful-git-branching-model/
- http://blog.plataformatec.com.br/2011/04/a-successful-git-branching-model/
git checkout -b myfeature
git commit -m "any comments..."
@juandebravo
juandebravo / DrupalClass.php
Created August 8, 2011 06:36 — forked from drslump/DrupalClass.php
Drupal Class to global functions
<?php
class DrupalClass {
static $instances = array();
public function __construct()
{
$class = get_class($this);
if (isset(self::$instances[$class])) return;
@juandebravo
juandebravo / gist:1237255
Created September 23, 2011 12:47
malformed uri
[qtp1863786032-71] [DEBUG] [2011-09-23 12:45:59,317] b.a.StreamsAppHandler: Changing stream with: UpdateStreamParams(connfu-stream-juandebravo-app-1,Some(connfu-stream-juandebravo-app-1),Some(connfu-stream-juandebravo-app-1),Some(Stream created using backchat-client gem),List(Filter(backchat://channel-1316781525/?q=,,false), Filter(,,false), Filter(,,false), Filter(,,false), Filter(,,false), Filter(,,false), Filter(connfu://channel-1316781986,,false)))
[qtp1863786032-71] [ERROR] [2011-09-23 12:45:59,322] b.w.StreamsApp: There was a problem in the webapp
mojolly.uri.MalformedBackchatUriException: The backchat uri [] is malformed, because:
at mojolly.uri.Uri$.apply(Uri.scala:144) ~[backchat-0.9.6-91573af-dist.jar:0.9.6]
at mojolly.uri.Uri$.apply(Uri.scala:158) ~[backchat-0.9.6-91573af-dist.jar:0.9.6]
at mojolly.uri.ParsedChannel$.apply(ParsedChannel.scala:9) ~[backchat-0.9.6-91573af-dist.jar:0.9.6]
at mojolly.LibraryImports$class.string2ParsedChannel(LibraryImports.scala:36) ~[backchat-0.9.6-91573af-dist.ja
@juandebravo
juandebravo / gist:1241975
Created September 26, 2011 10:16
error setting channels
[qtp961792455-72] [DEBUG] [2011-09-26 10:15:27,239] b.a.StreamsAppHandler: Changing stream with: UpdateStreamParams(connfu-stream-juandebravo-app-1,Some(connfu-stream-juandebravo-app-1),Some(connfu-stream-juandebravo-app-1),Some(Stream created using backchat-client gem),List(Filter(http://florianhanke.com/blog/atom.xml,,false), Filter(,,false), Filter(,,false), Filter(,,false), Filter(,,false), Filter(,,false), Filter(http://enekoknorr.com/feed/,,true)))
[qtp961792455-72] [ERROR] [2011-09-26 10:15:27,254] b.w.StreamsApp: There was a problem in the webapp
mojolly.uri.MalformedBackchatUriException: The backchat uri [] is malformed, because:
at mojolly.uri.Uri$.apply(Uri.scala:144) ~[backchat-0.9.7-8eeefe3-dist.jar:0.9.7]
at mojolly.uri.Uri$.apply(Uri.scala:158) ~[backchat-0.9.7-8eeefe3-dist.jar:0.9.7]
at mojolly.uri.ParsedChannel$.apply(ParsedChannel.scala:9) ~[backchat-0.9.7-8eeefe3-dist.jar:0.9.7]
at mojolly.LibraryImports$class.string2ParsedChannel(LibraryImports.scala:36) ~[backchat-0.9.7-8eeefe3-dist.j
class AhnPluginDemo < Adhearsion::Plugin
dialplan :foo
dialplan [:bar, :bazz]
dialplan :ahn_plugin_demo do |call|
logger.debug call.to_s
end
def bazz(call)
logger.debug call.to_s
def play(*arguments)
result = true
arguments.each do |argument|
case argument
when Hash
value = argument.delete(:value)
play_ssml_for(value, argument)
when RubySpeech::SSML::Speak
play_ssml argument
else
@juandebravo
juandebravo / main_re.py
Created February 7, 2012 23:35
Cast CamelCase to "underscore_case"
import re
import json
def add_underscore(letter):
return "_"+letter.group(0).lower()
def to_lower(letter):
return letter.group(0).lower()
def cast_to_underscore_case(value):
@juandebravo
juandebravo / gist:2199750
Created March 25, 2012 21:05
client validation
obj = ParamsValidator::Request.new
obj[:data] = "this is a log"
obj[:level] = 1
ruleset = MockObject.get_rule(:method2)
obj.valid?(ruleset) # false
begin
obj.validate(ruleset)
rescue ArgumentError => ae
p ae.message # array with validation errors
end
@juandebravo
juandebravo / cpython_json_cjson_pickle.py
Created April 4, 2012 22:12
cpython_json_cjson_pickle
import time
import cPickle as pickle
import json
import cjson
import ujson
d = {
'foo': 'bar',
'food': 'barf',
'good': 'bars',