Skip to content

Instantly share code, notes, and snippets.

View soardex's full-sized avatar

Edward Fitz Bucud Abucay soardex

View GitHub Profile
@soardex
soardex / SIMPLE_THREEJS_SAMPLE.html
Created June 23, 2014 17:10
Loading THREE.JS models
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<style>
body {
background-color: #ffffff;
margin: 0;
overflow: hidden;
@soardex
soardex / COMBINATION_QTPYTHON.txt
Created June 23, 2014 17:13
QT 4 Python simple sample that maps coordinates to json
#!/usr/bin/env python
import os
import sys
import random
import json
import uuid
from PyQt4 import Qt, QtGui, QtCore
from spritemapper_ui import Ui_Dialog
@soardex
soardex / HELLO.asm
Last active August 29, 2015 14:20
Hello World Assembly Language
; compiling on x86-64
; nasm -f elf64 hello.asm -o hello.o
; ld -s -o hello hello.o
section .text
global _start
_start:
mov eax,4 ; system call ID: sys_write
mov ebx,1 ; file descriptor for standard output
@soardex
soardex / gist:e95cdc230d1ac5b824b3
Created May 9, 2015 01:15
Install rbenv in CentOS 7
# install build dependencies
sudo yum install -y git-core zlib zlib-devel gcc-c++ patch readline readline-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison curl sqlite-devel
# clone and install rbenv environment
cd ~
git clone git://github.com/sstephenson/rbenv.git .rbenv
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
@soardex
soardex / gist:a1001dd9e11e1d871170
Created May 9, 2015 04:44
Change timezone in CentOS
# backup current localtime
mv /etc/localtime /etc/localtime.bak
# set link to current timezone (e.g. Asia/Manila)
ln -s /usr/share/zoneinfo/[timezone] /etc/localtime
@soardex
soardex / gist:5f63db181446c1d10660
Created May 9, 2015 06:25
Enable IPv4 only in Bind9 CentOS
# comment out the following lines on /etc/named.conf
listen-on-v6 port 53 { ::1; };
# and edit the following files /etc/sysconfig/named and add
OPTIONS="-4"
@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]
@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: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: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