Skip to content

Instantly share code, notes, and snippets.

View iKlsR's full-sized avatar
😲
daemon.

iKlsR

😲
daemon.
View GitHub Profile
@iKlsR
iKlsR / sdl_boilerplate.c
Created January 2, 2013 23:32
boilerplate for sdl.. (portable..)
#include <SDL/SDL.h>
void _dispatch(SDL_Event e, bool * r) {
while (SDL_PollEvent (&e)) {
switch (e.type) {
case SDL_QUIT:
*r = false;
break;
}
}
@iKlsR
iKlsR / sstack.cpp
Created December 30, 2012 16:01
a very very simple stack..
#include <iostream>
#include <string>
using namespace std;
template <class _st> class stack {
public:
stack();
void push(_st i);
@iKlsR
iKlsR / pine.asm
Created December 24, 2012 04:04
early beginnings of a bootloader.. codenamed PINE
; -- nasm -f bin pine.s -o pine.bin
; -- copy pine.bin pine.img
; -- boot!
[BITS 16] ; make this into 16bit code
[ORG 0x7C00] ; load into memory here
_main:
mov ax, 0x0000 ; setup the data segment register (step1)
mov ds, ax ; move ax into ds (step2)
@iKlsR
iKlsR / vim_in_a_(shell)
Created December 22, 2012 07:31
working_with_vim
start vim
while editing is not finished, repeat
navigate to desired position in NORMAL mode
enter INSERT mode by pressing i
type text
exit INSERT mode by pressing <ESCAPE>
when editing is finished, type :wq
sourced from : http://37.200.69.165/doku.php?id=llthw:ex1
@iKlsR
iKlsR / x86_x64_asm_build.sublime-build
Created December 19, 2012 20:42
x86_64 assembly build system for sublime text 2
{
"cmd": ["nasm", "-f", "bin", "${file}", "-o", "${file_path}/${file_base_name}.COM"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}"
}
// syntax for cmdline building : http://www.nasm.us/xdoc/2.10.06/html/nasmdoc2.html#section-2.1
// syntax for sublime build system : http://sublimetext.info/docs/en/reference/build_systems.html (outdated)?
// replace nasm and update switches as needed.. ;ie.. fasm etc
// ${file} refers to the current saved file.. ${file_path} etc..
@iKlsR
iKlsR / cmingw.bat
Created October 17, 2012 14:54
my special build script for blender x64 with mingw64 having mingwx86(in path) and cygwin then compress
@echo off
echo INFO -- mingw64/bin added to path
set Path=C:\mingw64\bin;%PATH%
echo INFO -- navigating to cygwin/bin
cd ../../../cygwin/bin
echo INFO -- moving troublesome sh.exe to tmp dir
move sh.exe C:\Users\iKlsR
@iKlsR
iKlsR / mooar
Created August 14, 2012 02:36
errrrr
#include "iostream"
#include <stdlib.h>
#include <stdio.h>
using namespace std;
int main(int argc, char const *argv[])
{
long long unsigned int * ptr = new long long unsigned int; /* modern */
@iKlsR
iKlsR / unpack
Created August 14, 2012 02:19
stupid.. i hate **kwargs :) no i love it
#include "iostream"
using namespace std;
int unpack(int array[], int size) {
int index = 0;
int i = 0;
for(; i < size; ++i)
@iKlsR
iKlsR / bloodust draw code etc...
Created August 12, 2012 17:11
hrrmm code from irc
#include "model.hpp"
#include "global.hpp"
#include <sys/stat.h>
#include <glm/gtx/integer.hpp>
#include <glm/gtc/quaternion.hpp>
#include <glm/gtx/quaternion.hpp>
#include <assimp/postprocess.h>
#include <assimp/scene.h>
#include <sstream>
@iKlsR
iKlsR / poor_me.c
Last active October 8, 2015 02:08
something something almost swizzly vectorish for the poor
#include <stdio.h>
typedef struct {
char t;
int x, y;
} swizzle;
swizzle image;