Skip to content

Instantly share code, notes, and snippets.

View ScatteredRay's full-sized avatar

Indy Ray ScatteredRay

  • San Francisco, Ca
View GitHub Profile
template <typename t>
void DeleteAllIn(t& iteratable)
{
for(t::iterator it = iteratable.begin(); it != iteratable.end(); it++)
delete *it;
}
Creating qmake. Please wait...
g++ -c -o project.o -pipe -DQMAKE_OPENSOURCE_EDITION -g -fconstant-cfstrings -I. -Igenerators -Igenerators/unix -Igenerators/win32 -Igenerators/mac -Igenerators/symbian -I/Users/Indy/dev/qt/qt/include -I/Users/Indy/dev/qt/qt/include/QtCore -I/Users/Indy/dev/qt/qt/src/corelib/global -I/Users/Indy/dev/qt/qt/src/corelib/xml -DQT_NO_PCRE -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_STL -DQT_NO_COMPRESS -I/Users/Indy/dev/qt/qt/mkspecs/macx-g++ -DHAVE_QCONFIG_CPP -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT project.cpp
In file included from /Users/Indy/dev/qt/qt/include/QtCore/qdatastream.h:1,
from /Users/Indy/dev/qt/qt/include/QtCore/../../src/corelib/tools/qstringlist.h:46,
from /Users/Indy/dev/qt/qt/include/QtCore/qstringlist.h:1,
from project.h:45,
from project.cpp:42:
/Users/Indy/dev/qt/qt/include/QtCore/../../src/corelib/io/qdatastream.h:45:35: erro
class BrowserWindow : public QMainWindow {
Q_OBJECT
private:
class AsyncServerQuery* Query;
...
public slots:
void ServerInfoReceived(struct SteamServerInfo Info);
};
BrowserWindow::BrowserWindow(QWidget *parent) :
GLuint CreateShaderProgram(shader_id shader)
{
GLuint vshader = CreateShader(GetVShaderFile(shader), GL_VERTEX_SHADER);
if(!vshader) goto error;
GLuint pshader = CreateShader(GetVShaderFile(shader), GL_FRAGMENT_SHADER);
if(!pshader) goto error_pshader;
GLuint program = glCreateProgram();
(def L '())
(defn add-item [i]
(def L (cons i L))
(add-item 1)
(add-item 2)
....
@ScatteredRay
ScatteredRay / gist:816134
Created February 8, 2011 08:54
clojure macro
(def L '())
(defn add-fun [i]
(def L (cons i L))
(defn fn1 [] ...)
(add-item fn1)
(defn fn2 [] ...)
(add-item fn2)
@ScatteredRay
ScatteredRay / gist:2439988
Created April 21, 2012 22:26
package.loaders
int lua_load_module(lua_State* lua)
{
const char* lua_file = lua_tostring(lua, -1);
lua_pop(lua, 1);
luaL_loadfile(lua, lua_file);
return 1;
}
int lua_find_module(lua_State* lua)
{
@ScatteredRay
ScatteredRay / cmakelists.txt
Created August 29, 2012 23:34
Two project CMake
SET (this_target PROJECT1)
PROJECT(${this_target})
...
ADD_EXECUTABLE(#{this_target} ...)
SET (this_target PROJECT2)
PROJECT(${this_target})
@ScatteredRay
ScatteredRay / gist:4158860
Created November 28, 2012 03:26
font-lock
(defun substitute-pattern (pattern symbol)
"Add a font lock hook to replace the matched part of PATTERN with the
Unicode symbol SYMBOL looked up with UNICODE-SYMBOL."
(interactive)
(font-lock-add-keywords
nil `((,pattern (0 (progn (put-text-property (match-beginning 1) (match-end 1)
'display ,symbol)
nil))))))
(defun substitute-patterns (patterns)
funcall(
->
doShit()
if x
moreShit()
)