Skip to content

Instantly share code, notes, and snippets.

@zhuzhonghua
zhuzhonghua / gist:9020276
Created February 15, 2014 14:51
reset android device
#!/bin/bash
#
sudo adb kill-server
sudo service udev stop
sudo adb start-server
sudo adb devices
http://blog.csdn.net/dfqin/article/details/6901506
#include <GLES2/gl2.h>
#include <SDL.h>
struct myData {
SDL_Window *window;
SDL_GLContext context;
};
var fs = require('fs');
var LOGS = new Array();
var ERRORS = new Array();
var CRASHS = new Array();
var filePre = "log";
function LOG(cxt)
var net = require('net');
function ByteBuffer(para)
{
this.pos = 0;
// read
if(Buffer.isBuffer(para)){
this.buffer = para;
}
// write, len
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.63])
AC_INIT([Server], [1.0], [hello@world.com])
AM_INIT_AUTOMAKE
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
aclocal
autoconf
echo "AUTOMAKE_OPTIONS= foreign" >> Makefile.am
echo "bin_PROGRAMS= Server" >> Makefile.am
echo "Server_SOURCES= \\" >> Makefile.am
sed -n '/ClCompile Include=/p' helloworld.vcxproj | sed -n 's/\\/\//gp' | awk -F= '{print $2}' | awk -F\" '{print $1}' | sed ':label;N;s/\n/ /g;b label' >> Makefile.am
@zhuzhonghua
zhuzhonghua / gist:d166dfff1f80a4b428eb
Created December 16, 2014 03:29
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.47.el6_2.9.i686 libgcc-4.4.6-3.el6.i686 libstdc++-4.4.6-3.el6.i686
http://stackoverflow.com/questions/10389988/missing-separate-debuginfos-use-debuginfo-install-glibc-2-12-1-47-el6-2-9-i686
yum install yum-utils
debuginfo-install --nogpgcheck xxx
@zhuzhonghua
zhuzhonghua / gist:ab97855e11be13d72b6c
Last active August 29, 2015 14:11
turn chrome browser into a text editor
data:text/html, <html contenteditable>
data:text/html, <html><body style="" contenteditable spellcheck="false">
/**********************************************************************
Filename : xxx
**********************************************************************/
替换类似这样的字符串
1. 先写正则表达式找到他们
\/\*+([^\*]|\r|\n)+\*+\/
2. 然后用自己喜欢的文字替换,或者直接删除也行
var MongoClient = require('mongodb').MongoClient,
db;
// Initialize connection once
MongoClient.connect("mongodb://localhost:27017/location", function(err, database) {
if (err) throw err;
db = database;
var places = db.collection('places');