Skip to content

Instantly share code, notes, and snippets.

View kevinw's full-sized avatar

Kevin Watters kevinw

View GitHub Profile
@kevinw
kevinw / gist:89218
Created April 2, 2009 14:31
googletest leak checker
#ifndef MemLeakCheckingTest_h
#define MemLeakCheckingTest_h
#include <gtest/gtest.h>
#if defined(WIN32) && defined(_DEBUG)
// Used to redirect _CrtXXX functions output to stderr, instead of the MSVC
// trace window.
int __cdecl crtReportHook(int reportType, char *szMsg, int *retVal)
<!doctype html>
<html>
<head>
<link rel=StyleSheet href="feed.css" type="text/css" media=screen>
<script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.js"></script>
<script>
function onclick() {
var childWindow = window.open('about:blank');
$(childWindow).unload(function() {alert('foo');});
}
static Mutex* sharedResourceMutex(curl_lock_data data) {
DEFINE_STATIC_LOCAL(Mutex, cookieMutex, ());
DEFINE_STATIC_LOCAL(Mutex, dnsMutex, ());
switch (data) {
case CURL_LOCK_DATA_COOKIE:
return &cookieMutex;
case CURL_LOCK_DATA_DNS:
return &dnsMutex;
default:
from traceback import print_exc
class debug_property(object):
'''
Doesn't squash AttributeError.
'''
def __init__(self, fget=None, fset=None, fdel=None, doc=None):
self.__get = fget
self.__set = fset
<typename Value, typename HashFunctions, typename Traits>
<typename T, typename HashTranslator>
<typename HashSet<Value, HashFunctions, Traits>::iterator, bool>
<Value, HashFunctions, Traits>::add(const T& value)
{
typedef HashSetTranslatorAdapter<ValueType, ValueTraits, T, HashTranslator> Adapter;
return m_impl.template addPassingHashCode<T, T, Adapter>(value, value);
}
typedef void MainThreadFunction(void*);
void callOnMainThread(MainThreadFunction*, void* context);
template <typename T>
static void deref(void* obj)
{
static_cast<T*>(obj)->deref();
}
diff -r 172c3949e621 ropemode/interface.py
--- a/ropemode/interface.py Wed Feb 03 22:34:27 2010 +0300
+++ b/ropemode/interface.py Thu Feb 11 12:04:04 2010 -0500
@@ -85,7 +85,10 @@
if self.project is not None:
self.close_project()
progress = self.env.create_progress('Opening [%s] project' % root)
- self.project = rope.base.project.Project(root)
+ fscommands = None
+ if self.env.get('editor_changes'):
diff -r 1216cb0e6b25 rope/base/change.py
--- a/rope/base/change.py Thu Feb 04 22:41:45 2010 +0300
+++ b/rope/base/change.py Thu Feb 11 12:03:54 2010 -0500
@@ -123,8 +123,9 @@
"""
def call(self, job_set=taskhandle.NullJobSet()):
job_set.started_job(str(self))
- function(self)
+ res = function(self)
job_set.finished_job()
diff -r 5a125fe3302d ropevim.py
--- a/ropevim.py Fri Feb 05 00:33:19 2010 +0300
+++ b/ropevim.py Thu Feb 11 12:07:55 2010 -0500
@@ -7,6 +7,8 @@
import ropemode.environment
import ropemode.interface
+import rope.base.fscommands as fscommands
+
import vim
(?:^|\s)((?:\&quot\;\(\^\_\^\)\&quot\;)|(?:\&lt\;\/sarcasm\&gt\;)|(?:\(\¬\_\¬\&quot\;\))|(?:\(n\/\/\/n\))|(?:\&gt\;\:\-O)|(?:\&gt\;\:o)|(?:\(\.O\.\'\))|(?:\(sarc\))|(?:\(sick\))|(?:\(\-\_\_\-\))|(?:\(\-\_\-\)p)|(?:\(\^\_\^\)d)|(?:\(T\_T\))|(?:\(\.\_\.\))|(?:\(u\_u\))|(?:\(\^O\^\))|(?:\(\*\_\*\))|(?:\&lt\;3)|(?:\(\♥\_\♥\))|(?:\)\^o\^\()|(?:\(OwO\))|(?:\(O\_O\))|(?:\(\$\_\$\))|(?:\(o\_O\))|(?:\(\^\_\^\))|(?:\(\=\_\=\))|(?:\(\ò\_\ó\))|(?:\(\^\_\-\))|(?:O\:\-\))|(?:o\:\-\))|(?:\:\-\[)|(?:\:\-S)|(?:\:\-s)|(?:\:\'\()|(?:\:\-\!)|(?:\:\-\|)|(?:\:\-\()|(?:\=\-o)|(?:\:\-D)|(?:O\:\))|(?:o\:\))|(?:\(A\))|(?:\(L\))|(?:8\-\))|(?:\(H\))|(?:\:\-\*)|(?:\(K\))|(?:\=\-O)|(?:\:\-O)|(?:\:\-x)|(?:\:\-X)|(?:\:\-\$)|(?:\$\-\))|(?:P\-\[)|(?:\:\[\[)|(?:\:\-\))|(?:\^\_\^)|(?:\:\-p)|(?:\:\-P)|(?:\(N\))|(?:\(n\))|(?:\(Y\))|(?:\(y\))|(?:\:\-\\)|(?:\:\-\/)|(?:\:\-\@)|(?:\;\-\))|(?:\:\[)|(?:\:S)|(?:\:s)|(?:\:\!)|(?:\:\|)|(?:\:\()|(?:\:o)|(?:\:D)|(?:8\))|(?:\:\*)|(?:\:O)|(?:\=O)|(?:\:X)|(?:\:x)|(?:\:\$)|(?:\$\))|(?:\^\))|(?:\:\))|(?:\:P)|(?: