Skip to content

Instantly share code, notes, and snippets.

View soardex's full-sized avatar

Edward Fitz Bucud Abucay soardex

View GitHub Profile
### Some Keybinds that I always forgot
Alt + C - Convert to mesh.
Ctrl + Alt + Numpad 0 - Snap the camera to the position of the view.
Shift + B - Render border.
Ctrl + Alt + B - Clear render border.
M - Object move to layer.
### Navigation
@soardex
soardex / gist:eb3fc9f6db6a75c06af8
Created May 31, 2015 14:51
Useful commands for GDB
### going back the backtrace
backtrace
select-frame [frameno]
up
down
### reversing stepping in the code
target record-full
reverse-{next, continue, step}
@soardex
soardex / gist:f7026f1f427662935dfa
Created May 26, 2015 08:23
Building libraries using MinGW
# build library dll
g++ -c -DBUILDING_EXAMPLE_DLL example_dll.cpp
g++ -shared -o example_dll.dll example_dll.o -Wl,--out-implib,libexample_dll.a
# build executable
g++ -c example_exe.cpp
g++ -o example_exe.exe example_exe.o -L. -lexample_dll
# build without an import library
g++ -o example_exe.exe example_exe.o example_dll.dll
@soardex
soardex / gist:226cca23abdb6fd2d370
Created May 26, 2015 08:16
Loading functions from `dll` or `so`
/// compiling:
/// g++ -std=c++0x -o example example.cpp -I./libtool/include/ -L./libtool/lib/ -lltdl
///
#include <cstdio>
#include <iostream>
#include <memory>
#include <ltdl.h>
int main()
@soardex
soardex / gist:aa51efd34ee25bf9018c
Created May 22, 2015 00:45
Most simplest GLSL vertex and fragment shader for testing
# vertex shader
```
#version 150
attribute vec3 position;
void main()
{
gl_Position = vec4(position, 1.0);
}
```
@soardex
soardex / gist:3718f105bfa1b64602bc
Created May 20, 2015 12:55
Generate Makefile for libRocket using MinGW32
# here is the cmake command to generate makefile
cmake -G "Unix Makefiles" -D CMAKE_MAKE_PROGRAM="mingw32-make.exe" -D FREETYPE_INCLUDE_DIRS="../Dependencies/freetype/include;../Dependencies/freetype/include/freetype2" -D FREETYPE_LIBRARY="../Dependencies/freetype/lib/libfreetype.dll.a" .
@soardex
soardex / gist:8a372987ac34fabe2803
Created May 20, 2015 09:35
Build GLEW in MinGW
# create a file named compile.bat in the **root** directory of the glew build director
# it will create files .a and .dll in lib directory
gcc -DGLEW_NO_GLU -O2 -Wall -W -Iinclude -DGLEW_BUILD -o src/glew.o -c src/glew.c
gcc -shared -Wl,-soname,libglew32.dll -Wl,--out-implib,lib/libglew32.dll.a -o lib/glew32.dll src/glew.o -L/mingw/lib -lglu32 -lopengl32 -lgdi32 -luser32 -lkernel32
ar cr lib/libglew32.a src/glew.o
gcc -DGLEW_NO_GLU -DGLEW_MX -O2 -Wall -W -Iinclude -DGLEW_BUILD -o src/glew.mx.o -c src/glew.c
gcc -shared -Wl,-soname,libglew32mx.dll -Wl,--out-implib,lib/libglew32mx.dll.a -o lib/glew32mx.dll src/glew.mx.o -L/mingw/lib -lglu32 -lopengl32 -lgdi32 -luser32 -lkernel32
ar cr lib/libglew32mx.a src/glew.mx.o
@soardex
soardex / gist:19bf3900425f9cc82a22
Created May 18, 2015 13:42
Mounting and Creating VHD in Windows
# run `diskpart` command
# inside diskpart type the commands
# this commands create 16GB of virtual hard disk
create vdisk file="file.vhd" maximum=16000
# attach the vdisk and create partition
attach vdisk
create partition primary
@soardex
soardex / gist:9aaa125448f74b393981
Created May 17, 2015 14:13
Convert img to vdi using VirtualBox
# here is the code to convert img to vdi format
# it is useful especially for uefi based image
VBoxManage convertfromraw --format VDI [filename].img [filename].vdi
@soardex
soardex / gist:ff1aa5a1ded192201df9
Created May 17, 2015 10:36
Enable and disable tracking of a single file in Git
# stops checking the working tree file for possible modification
git update-index --assume-unchanged [filename]
# does the opposite of the above (starts checking)
git update-index --no-assume-unchanged [filename]