Skip to content

Instantly share code, notes, and snippets.

View reidrac's full-sized avatar

Juan J. Martínez reidrac

View GitHub Profile
#include "d64.h"
int
main()
{
cputs("Hello 6502 world from C!\n");
return 0;
}

Keybase proof

I hereby claim:

  • I am reidrac on github.
  • I am reidrac (https://keybase.io/reidrac) on keybase.
  • I have a public key whose fingerprint is F014 056F 18EB 14C1 7293 A337 ED2C 8FDF EA11 2704

To claim this, I am signing this object:

function collision(self, other) {
// x, y: position
// w, h: dimension
// r: radius of the circumference
var x = (other.x+other.w/2)-(self.x+self.w/2),
y = (other.y+other.h/2)-(self.y+self.h/2),
r = other.r+self.r;
return x*x + y*y <= r*r;
$ make
zcc +zx -O2 -m -vn -Wall -I../z88dk/include game.c -o game.bin -lsp1 -lmalloc -lim2 -zorg=28672
sccz80:"game.c" L:251 Error:#42:Unknown symbol: s
sccz80:"game.c" L:251 Error:#36:Can't take member
Compilation aborted
*** Error in `sccz80': free(): invalid size: 0x09cea1e0 ***
======= Backtrace: =========
/lib/libc.so.6[0x45e8d143]
/lib/libc.so.6[0x45e94cba]
sccz80[0x8056e18]
@reidrac
reidrac / test2.py
Last active August 29, 2015 14:06
Second test with SST
from sst.actions import *
go_to("http://t-touch.com/")
wait_for(assert_displayed, "tissot-logo")
e = get_element_by_css("#footer-link > a:nth-child(1)")
click_link(e)
switch_to_window(1)
e = get_element_by_css("body > div.wbx-wrapper-main > header > div > div.wrapper-content.navigation > nav > ul > li.first > div > div > a > img")
assert_displayed(e)
@reidrac
reidrac / test1.py
Created September 21, 2014 10:49
learning sst (first exercise)
from sst.actions import *
go_to('http://shinydemos.com/')
e = get_element_by_xpath('//*[@id="navigation"]/ul/li[3]/a')
click_link(e)
assert_title(u"CSS 3 \u2014 Shiny Demos")
e = get_element_by_xpath('//*[@id="js"]/body/div/ul/li[5]/a')
click_link(e)
assert_displayed("doit")
#include <SFML/System/Time.hpp>
#include <SFML/System/Mutex.hpp>
#include <SFML/System/Lock.hpp>
#include <SFML/Audio/Music.hpp>
class ExtMusic : public sf::Music
{
public:
ExtMusic() : m_ext_loop(false) { }
class A(object):
def __init__(self):
self.a = True
def method(self):
if not self.a:
test = 1
BIN=main
CXX=g++
CXXFLAGS=-I. -c -Wall -ggdb -DDEBUG
LDFLAGS=
LIBS=-lsfml-system -lsfml-graphics -lsfml-window
SOURCES=$(wildcard *.cc)
OBJECTS=$(SOURCES:.cc=.o)
all: $(SOURCES) $(BIN)
@reidrac
reidrac / mysprite.py
Last active August 29, 2015 13:57
Use pyglet sprites, but with a scaling filter that suits pixelated graphics
"""
Class to use Pyglet 1.2 sprites, but with a scaling filter that suits pixelated graphics.
Just import and use PixSprite as it was a Sprite!
"""
import pyglet
from pyglet import gl
class PixSprite(pyglet.sprite.Sprite):
def __init__(self, *args, **kwargs):