Skip to content

Instantly share code, notes, and snippets.

View ggarber's full-sized avatar

Gustavo Garcia ggarber

View GitHub Profile
@ggarber
ggarber / gist:1672311
Created January 24, 2012 20:16
trunk/Android.mk
# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
MY_WEBRTC_ROOT_PATH := $(call my-dir)
@ggarber
ggarber / gist:1672321
Created January 24, 2012 20:18
trunk/Application.mk
APP_BUILD_SCRIPT = Android.mk
APP_PLATFORM := android-9
APP_CPPFLAGS += -fno-rtti
APP_ABI := armeabi
APP_STL := stlport_static
@ggarber
ggarber / main_re.py
Created February 8, 2012 09:23 — forked from juandebravo/main_re.py
Cast CamelCase to "underscore_case"
import re
def _camel_to_underscore_case(name):
"""
Translate 'CamelCaseNames' to 'camel_case_names'.
"""
camelcase_boundry = '((?<=[a-z])[A-Z])'
return re.sub(camelcase_boundry, '_\\1', name).lower()
def camel_to_underscore_case(obj, deep=True):
@ggarber
ggarber / main_re.py
Created February 8, 2012 14:28 — forked from rafeca/main_re.py
Cast CamelCase to "underscore_case"
import re
def _camel_to_underscore_case(name):
"""
>>> _camel_to_underscore_case('CamelCaseNames')
'camel_case_names'
"""
camel_boundry = '((?<=[a-z])[A-Z])'
return re.sub(camel_boundry, '_\\1', name).lower()
@ggarber
ggarber / gist:2265395
Created March 31, 2012 14:19
Improve readable djanto tests
@authorize
def invalid():
get(URL,x,x,y)
assert_response(200, xpath)
assert_db(Users.objects.find('xxx'))
@ggarber
ggarber / cpython_json_cjson_pickle.py
Created June 7, 2012 08:22 — forked from juandebravo/cpython_json_cjson_pickle.py
cpython_json_cjson_ujson_pickle (encode+decode)
import time
import cPickle as pickle
import json
import cjson
import ujson
d = {
'foo': 'bar',
'food': 'barf',
'good': 'bars',
@ggarber
ggarber / gist:3119020
Created July 15, 2012 22:53
SIP websockets to TCP proxy
var net = require('net'),
ws = require('ws'),
sip = require('sip');
var wss = new ws.Server({port: 8080});
var LINES_FILTER_REGEX = /^a=candidate.*|^a=crypto.*/;//|^a=ssrc.*/;
wss.on('connection', function(ws) {
console.log('received connection');
@ggarber
ggarber / android_decompile.sh
Created September 30, 2012 15:08
Download apk from google play and decompile it
#!/bin/sh
# https://github.com/egirault/googleplay-api
GOOGLEPLAY_API_PATH=/Users/ggb/software/tools/googleplay-api
# http://code.google.com/p/dex2jar/
DEX2JAR_PATH=/Users/ggb/software/tools/dex2jar-0.0.9.8
# http://www.varaneckas.com/jad/
JAD_PATH=/Users/ggb/software/tools/jad158g.mac.intel
${GOOGLEPLAY_API_PATH}/download.py $1

var signalingChannel = new SignalingChannel(); var conn;

// call start() to initiate function start() { var sock = new RTCSocket([{ url: "stun:stun.example.org" }]); conn = new RTCConnection(sock);

// send my ICE details to the other peer

<!doctype>
<link type="text/css" rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
<link type="text/css" rel="stylesheet" href="../src/css/graph.css">
<link type="text/css" rel="stylesheet" href="../src/css/detail.css">
<link type="text/css" rel="stylesheet" href="../src/css/legend.css">
<link type="text/css" rel="stylesheet" href="css/extensions.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.15/jquery-ui.min.js"></script>