Skip to content

Instantly share code, notes, and snippets.

@dinox0r
dinox0r / demo.asm
Created April 3, 2024 09:30
Demo for the "Retro Game programming with Atari 2600" presentation
PROCESSOR 6502
INCLUDE "vcs.h"
LIST ON ; turn on program listing, for debugging on Stella
;=============================================================================
; MEMORY / VARIABLES
;=============================================================================
SEG.U variables
import com.google.common.base.Stopwatch;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.awt.image.DataBufferInt;
import java.io.File;
import java.io.IOException;
import java.util.Random;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.PDResources;
import org.apache.pdfbox.pdmodel.graphics.form.PDFormXObject;
import org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.security.MessageDigest;
import java.util.ArrayDeque;
@dinox0r
dinox0r / .vimrc
Last active November 4, 2019 12:37
vimrc file
scriptencoding utf-8
"-------
"PLUGINS
"-------
"Specify a directory for plugins
call plug#begin('~/.vim/plugged')
"fzf
Plug 'junegunn/fzf.vim'
Plug 'tweekmonster/fzf-filemru'
@dinox0r
dinox0r / oEmbed-sequence-diag.txt
Created May 28, 2018 02:25
ASCII sequence diagram for oEmbed process
**************************************************************************************************************
* +---------+ +-----------------+ +-------------+ +-----------------+ *
* | | | | | | | | *
* | Client | | DocumentService | | Document DB | | Oembed resolver | *
* | | | | | | | | *
* +----+----+ +--------+--------+ +------+------+ +--------+--------+ *
* | | | | *
* | | | | *
* | | | | *
* | addOEm
@dinox0r
dinox0r / either.js
Created August 29, 2017 08:12
either.js
'use strict';
let Left = x => this.__value = x;
Left.of = x => new Left(x);
Left.prototype.isRight = () => false;
Left.prototype.isLeft = () => true;
@dinox0r
dinox0r / options.js
Created August 29, 2017 08:12
option.js
'use strict';
let Option = x => this.__value = x;
Option.of = x => new Option(x);
Option.empty = x => new Option(null);
Option.prototype.isEmpty = () => this.__value === null || this.__value === undefined;
@dinox0r
dinox0r / ray-marching.glsl
Last active December 13, 2016 16:08
My first ray marcher! And I made it by myself YAAYYYY
float df_sphere(in vec3 ray, in float radious) {
return length(ray) - radious;
}
void mainImage(out vec4 frag_color, in vec2 frag_coord) {
float aspect = iResolution.y / iResolution.x;
vec3 eye = vec3(0.0, 0.0, -2.0);
vec3 ray = vec3((frag_coord.xy / iResolution.xy) - 0.5, -1.0) - eye;
ray.y *= aspect;
vec3 r = normalize(ray);
@dinox0r
dinox0r / up.sh
Created December 7, 2016 23:47
Utility function up 'bash'
function up() {
declare -i jumps
if [ $# -eq 0 ]; then
let jumps=1
fi
if [[ $1 =~ ^-?[0-9]+$ ]]; then
let jumps=$1
else
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include <limits>
int main() {
int t; std::cin >> t;
while (t--) {