Skip to content

Instantly share code, notes, and snippets.

View yuriks's full-sized avatar

Yuri Kunde Schlesner yuriks

View GitHub Profile
@yuriks
yuriks / gist:953747
Created May 3, 2011 17:14
SCV TODO
TODO para o SCV:
Bugs:
- Adicionar função para setar Headers da tabela.
- Tambem suportar a remoção completa do header, se desejado.
- Bug ao usar o display da label de dentro do canvas
- Poder remover componentes no designer.
- Arrumar o "don't must" na documentação.
Wishlist:
@yuriks
yuriks / parse.py
Created July 2, 2011 04:44
Lambda Expression parser
# data Expr = '(' PExpr ')' | PExpr
# data PExpr = Var | Apply | LExpr
# data Var = 'a'..'z'
# data Apply = Expr Expr
# data LExpr = '$' Var ( '.' Expr )?
import re
token_re = re.compile(r'\s*(?:(\w+)|(\$)|(\.)|(\()|(\))|(.))')
VAR = 1; LAMBDA = 2; DOT = 3; L_PAREN = 4; R_PAREN = 5; ERROR = 6
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.sound.sampled.*;
import java.io.*;
import java.util.concurrent.locks.*;
public class Audio implements KeyListener {
private Lock lock = new ReentrantLock();
@yuriks
yuriks / gist:1144547
Created August 14, 2011 03:55
yuriks' coding links collection
@yuriks
yuriks / gist:1251653
Created September 29, 2011 19:15 — forked from dennda/gist:1251646
uint8* dest = malloc(width * height * 4);
short* src = imgData;
for (int i = 0; i < width * height; ++i) {
short x = *src++;
*dest++ = (x >> 8) & 0xFF;
*dest++ = x & 0xFF;
*dest++ = 0;
*dest++ = 0;
}
@yuriks
yuriks / .gvimrc
Created January 4, 2012 06:47
yuriks' vim config
colorscheme slate
highlight SpecialKey gui=NONE guifg=#1a1a1a
highlight ModeMsg term=bold,reverse ctermfg=6 gui=bold,reverse guifg=goldenrod
highlight Search guibg=#7e5227 guifg=NONE
highlight LineNr guifg=grey60 guibg=grey25
highlight PreProc guifg=red guibg=NONE ctermfg=red
set guifont=Envy\ Code\ R:h10
set columns=120
u32 readWrappedTexel(CubeFace face, int x, int y) {
assert(face < NUM_FACES);
static const CubeFace face_left_of[] = {
/* FACE_POS_X */ FACE_POS_Z,
/* FACE_NEG_X */ FACE_NEG_Z,
/* FACE_POS_Y */ FACE_NEG_X,
/* FACE_NEG_Y */ FACE_NEG_X,
/* FACE_POS_Z */ FACE_NEG_X,
/* FACE_NEG_Z */ FACE_POS_X
@yuriks
yuriks / lines.cpp
Last active December 23, 2015 10:09
#include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <cstring>
using namespace std;
int m[300][300];
int H, W;
@yuriks
yuriks / MainMenu.txt
Created September 24, 2013 05:02
This is a script disassembly from a classic game (self-written disassembler). Can you guess which game is it?
; chunks\chunk1c6.bin - object D1h - entrypoint 84CEh vm
84CE: SPRVM.IP $8A0E ; Sets sub-vm instruction pointer
84D1: SPRVM.RUN ; Invoke animation VM
84D2: LDA #0 ; LoaD A { A = op0; }
84D5: STA ($selectedCharacter) ; STore A to memory
84D8: LDA #1000 ; LoaD A { A = op0; }
84DB: OBJPROP.ORA #8 ; OR current object property op0/2 with A
84DD: LDA #1234 ; LoaD A { A = op0; }
84E0: JE ($200), $84FF ; Jump if Equal { if (*op0 == A) goto op1; }
@yuriks
yuriks / annot.txt
Created October 2, 2013 03:37
ASM source annotated with jump arrows
; chunks\chunk1c6.bin - object D1h - entrypoint 84CEh vm
84CE: SPRVM.IP $8A0E ; Sets sub-vm instruction pointer
84D1: SPRVM.RUN ; Invoke animation VM
84D2: LDA #0 ; LoaD A { A = op0; }
84D5: STA ($selectedCharacter) ; STore A to memory
84D8: LDA #1000 ; LoaD A { A = op0; }
84DB: OBJPROP.ORA #8 ; OR current object property op0/2 with A
84DD: LDA #1234 ; LoaD A { A = op0; }
┌─ 84E0: JE ($200), $84FF ; Jump if Equal { if (*op0 == A) goto op1; }