Skip to content

Instantly share code, notes, and snippets.

@xieyu
xieyu / rs-connect.js
Created September 29, 2018 02:56 — forked from chrisckchang/rs-connect.js
replica set connection with nodejs native
/**
* MongoDB NodeJS Driver Production Connection Example
*
* Copyright (c) 2015 ObjectLabs Corporation
* Distributed under the MIT license - http://opensource.org/licenses/MIT
*/
var MongoClient = require('mongodb').MongoClient;
/**
@xieyu
xieyu / .ycm_extra_conf.py
Created January 21, 2014 08:54
configure for cocos2d 3.0 beta.
import os
import ycm_core
# These are the compilation flags that will be used in case there's no
# compilation database set (by default, one is not set).
# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
flags = [
#'-Wall',
#'-Wextra',
#'-Wno-long-long',
@xieyu
xieyu / .ycm_extra_conf.py
Last active January 1, 2016 12:29
.ycm_extra_conf.py for cocos2d on mac.
import os
import ycm_core
# These are the compilation flags that will be used in case there's no
# compilation database set (by default, one is not set).
# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
flags = [
'-Wall',
'-Wextra',
'-Wno-long-long',
@xieyu
xieyu / addrcallstack.py
Created July 4, 2012 11:28
rewrite addr2name.awk with python
#!/usr/bin/python
import subprocess
import sys
import re
import os
import string
def getSymbolsMapFromObjectFile(fileName):
output = subprocess.Popen(["nm", fileName], stdout = subprocess.PIPE, cwd = os.getcwd()).stdout.read()
entrys = output.split("\n")