Skip to content

Instantly share code, notes, and snippets.

repositories {
flatDir {
dirs 'libs'
}
}
dependencies {
compile 'com.keylemon.oasis:oasis:0.9@aar'
compile 'com.keylemon.camera:cameralibrary:0.9.3@aar'
compile 'com.android.support:appcompat-v7:21.0.0'
@anb
anb / gist:4944163
Last active December 13, 2015 16:59
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"/>
<script src="http://cmx.io/v/0.1/cmx.js"></script>
<body>
<scene id="scene1">
<label t="translate(0,346)">
<tspan x="0" y="0em">Pendant ce temps la chez joco</tspan>
</label>
<actor t="translate(131,49)" pose="-11,9|-5,117|-11,99|-11,89|-11,79|-11,59|-16,34|-21,9|-6,34|-1,9|-18,79|-18,59|-6,79|-1,59">
http://somehost:9292/_ruote/processes/20120104-hawochitzu
NoMethodError at /_ruote/processes/20120104-hawochitzu
undefined method `fei' for nil:NilClass
file: process_status.rb location: wfid line: 148
class TaskParticipant < Ruote::StorageParticipant
def consume(workitem)
doc = workitem.to_h
doc.merge!(
'type' => 'workitems',
'_id' => to_id(doc['fei']),
@anb
anb / anb.rb
Created January 4, 2012 08:45 — forked from anonymous/anb.rb
class AnbParticipant < Ruote::StorageParticipant
def consume(workitem)
if workitem.params['nonblock']
do_something
reply_to_engine(workitem)
else
super(workitem)
@anb
anb / gist:1218761
Created September 15, 2011 07:42
Baqueslachère
Python 2.6.7 (r267:88850, Sep 13 2011, 16:31:26)
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> exec "print 'toto'"
toto
>>> exec "print 'toto'\r\n"
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 1
print 'toto'
GREP_COLOR=1;32
MANPATH=/opt/local/share/man:/usr/share/man:/usr/local/share/man:/usr/X11/share/man:/opt/local/share/man
TERM_PROGRAM=Apple_Terminal
TERM=xterm-color
SHELL=/bin/bash
TMPDIR=/var/folders/Sb/SbK3zRVLE5Chw6KasxgUcE+++TI/-Tmp-/
GOBIN=/Users/anb/go/bin
Apple_PubSub_Socket_Render=/tmp/launch-zsxVGh/Render
TERM_PROGRAM_VERSION=273.1
OLDPWD=/Users/anb/manny/manny_web/manny/statistic
test = "fadslfasd 81.123.233.14 fadslkfjads kterstl adfs 10.10.11.10f sad"
ip = re.findall( r'[0-9]+(?:\.[0-9]+){3}', test )
In [29]: ip
Out[29]: ['81.123.233.14', '10.10.11.10']
In [1]: import re
In [2]: nonascii = re.compile('[^a-zA-Z]')
...: formatkey = lambda s: nonascii.sub('', s.lower().strip())
In [3]: test_string = "fdasafsdB324234_()324sdafasd[]$$$"
In [4]: formatkey(test_string)
Out[4]: 'fdasafsdbsdafasd'
{"SWITCH_STATUS": {"SHOW_INTERFACES": [{"Operational Status": "up"},
{"Last Time Link Changed": "THU APR 14 11:13:28"},
{"Number of Status Change": "155"},
{"Type": "Ethernet"},
{"SFP/XFP": "100Base-FX"},
{"MAC address": "00:e0:b1:df:ce:d2"},
{"BandWidth (Megabits)": "100Duplex : Full"},
{"Autonegotiation": "0[]"},
{"Long Frame Size(Bytes)": "9216"},
{"Rx": ""},