Skip to content

Instantly share code, notes, and snippets.

View rgs1's full-sized avatar
🎯
Focusing

Raúl Gutiérrez Segalés rgs1

🎯
Focusing
View GitHub Profile
#!/usr/bin/python 2.7
from __future__ import print_function
from cmd import Cmd
from functools import partial
import readline
class Param(object):
#!/usr/bin/python 2.7
from __future__ import print_function
from cmd import Cmd
from functools import partial
import readline
class CompleteParam(object):
@rgs1
rgs1 / -
Created June 27, 2014 21:47
[== Running python tests ==]
Build operating on targets: OrderedSet([PythonTestSuite(tests/python/twitter/common/BUILD:all)])
Failed to run test!
Traceback (most recent call last):
File "/home/rgs/d/commons/build-support/pants.venv/lib/python2.7/site-packages/twitter/pants/python/test_builder.py", line 204, in _run_python_test
builder = chroot.dump()
File "/home/rgs/d/commons/build-support/pants.venv/lib/python2.7/site-packages/twitter/pants/python/python_chroot.py", line 201, in dump
platforms=platforms)
File "/home/rgs/d/commons/build-support/pants.venv/lib/python2.7/site-packages/twitter/pants/python/resolver.py", line 109, in resolve_multi
@rgs1
rgs1 / -
Created June 28, 2014 21:59
diff --git a/bin/zk-shell b/bin/zk-shell
old mode 100644
new mode 100755
index a95c494..0796739
--- a/bin/zk-shell
+++ b/bin/zk-shell
@@ -1,6 +1,12 @@
#!/usr/bin/env python
-from zk_shell.cli import CLI
@rgs1
rgs1 / -
Created October 7, 2014 17:00
commit 0fced709be6924d15a3350999defc20420bbb801
Author: Raul Gutierrez S <rgs@twitter.com>
Date: Tue Oct 7 09:58:16 2014 -0700
Handle failed to open interface errors
Signed-off-by: Raul Gutierrez S <rgs@twitter.com>
diff --git a/zktraffic/base/sniffer.py b/zktraffic/base/sniffer.py
index 2106b8a..37cf5a6 100644
var getJSON = function(url, successHandler, errorHandler) {
var xhr = typeof XMLHttpRequest != 'undefined'
? new XMLHttpRequest()
: new ActiveXObject('Microsoft.XMLHTTP');
xhr.open('get', url, true);
xhr.onreadystatechange = function() {
var status;
var data;
if (xhr.readyState == 4) { // `DONE`
status = xhr.status;
var getJSON = function(url, successHandler, errorHandler) {
var xhr = typeof XMLHttpRequest != 'undefined'
? new XMLHttpRequest()
: new ActiveXObject('Microsoft.XMLHTTP');
xhr.open('get', url, true);
xhr.onreadystatechange = function() {
var status;
var data;
if (xhr.readyState == 4) { // `DONE`
status = xhr.status;
FB.login(function() {
FB.api('/me/feed', 'post', {message: 'Hello, world!'});
}, {scope: 'publish_actions'});
python> k.get("/")
Sending request(xid=2): GetData(path='/', watcher=None)
Received Ping
Received Ping
Received Ping
......
Received Ping
Received Ping
Received Ping
Reading for header ReplyHeader(xid=2, zxid=10197, err=0)
at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:398)
at java.net.ServerSocket.implAccept(ServerSocket.java:530)
at java.net.ServerSocket.accept(ServerSocket.java:498)
at org.apache.zookeeper.server.quorum.QuorumCnxManager$Listener.run(QuorumCnxManager.java:539)