Skip to content

Instantly share code, notes, and snippets.

@idank
idank / gist:5330287
Last active December 15, 2015 22:00
<html><head>
<title></title>
<meta content="width=device-width, initial-scale=1.0" name="viewport">
</head>
<body>
<div class="container">
<div style="height: 20px;"></div>
<div style="height: 20px;"></div>
<svg id="canvas" style="position:absolute; left:0; z-index:-1;"><circle cx="50" cy="50" r="10" fill="#fdd0a2"/><g transform="translate(0, 60)"><g transform="translate(1442, 179)"><circle r="4" fill="#fdd0a2"/></g></g></svg>
</div>
<!DOCTYPE html>
<html>
<body>
<div style="margin-right: auto; margin-left: auto; width: 940px;">
<div><h1>Title</h1></div>
<div style="height: 50px;"></div>
<svg id="canvas" style="width: 100%; position: absolute; left: 0px; z-index: -1;">
</svg>
<div id="div1">Hi</div>
<div id="div2"></div>
diff --git a/ut.c b/ut.c
index 8afe46c..88ebf7b 100644
--- a/ut.c
+++ b/ut.c
@@ -24,8 +24,7 @@ int ut_init(int tab_size)
tid_t ut_spawn_thread(void (*func)(int), int arg)
{
- ut_slot_t *p = ut_slots;
- p += sizeof(ut_slot_t)*thread_count;
diff --git a/ut.c b/ut.c
index 8afe46c..88ebf7b 100644
--- a/ut.c
+++ b/ut.c
@@ -24,8 +24,7 @@ int ut_init(int tab_size)
tid_t ut_spawn_thread(void (*func)(int), int arg)
{
- ut_slot_t *p = ut_slots;
- p += sizeof(ut_slot_t)*thread_count;
src = pymongo.Connection()
dst = pymongo.Connection(<mongos addr>)
srcdb = src[db]
dstdb = dst[db]
srccoll = srcdb[collection]
dstcoll = dstdb[collection]
logging.basicConfig(format='%(asctime)s %(message)s', level=logging.INFO)
opt_regex = re.compile(r'''
(?P<opt>--?(?:\?|\#|(?:\w+-)*\w+)) # option starts with - or -- and can have - in the middle but not at the end, also allow '-?'
(?:
(?:\s*(=)?\s*) # -a=
(?P<argoptional>[<\[])? # -a=< or -a=[
(?:\s*(=)?\s*) # or maybe -a<=
(?P<arg>
(?(argoptional) # if we think we have an arg (we saw [ or <)
[^\]>]+ # either read everything until the closing ] or >
|
2013-12-21 13:28:18,725 tasks ERROR --- GEVENT STACKTRACE 0: File "/usr/local/lib/python2.7/dist-packages/gevent/greenlet.py", line 390, in run
result = self._run(*self.args, **self.kwargs)
File "/usr/local/lib/python2.7/dist-packages/celery/concurrency/base.py", line 34, in apply_target
ret = target(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 327, in _fast_trace_task
return _tasks[task].__trace__(uuid, args, kwargs, request)[0]
File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 238, in trace_task
R = retval = fun(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 416, in __protected_call__
return self.run(*args, **kwargs)
int _initialize_mtmm() {
// initialization code goes here...
return 1;
}
int _mtmm_initialized = _initialize_mtmm();
void* malloc(size_t) {
// just to be safe...
# BAD, not backward compatiable
def decode_message(msg):
arg1 = msg['arg1']
..
argn = msg['argn']
do_work(arg1, .., argn)
# OK
def decode_message(msg):
# arg1 might be deleted, or not exist at all
# encoding: utf-8
require 'gcloud'
require 'faraday'
module Faraday
class Adapter
class NetHttp < Faraday::Adapter
def ssl_verify_mode(ssl)
OpenSSL::SSL::VERIFY_NONE
end