Skip to content

Instantly share code, notes, and snippets.

@honix
honix / README.md
Last active January 29, 2019 13:10
SCRIPT-8
@honix
honix / shaders.frag
Last active December 5, 2018 09:50
glsl shader principles
#ifdef GL_ES
precision mediump float;
#endif
#extension GL_OES_standard_derivatives : enable
uniform float time;
uniform vec2 mouse;
uniform vec2 resolution;
void Update () {
// ...
// - Body
// \_ - Camera
// Rotate full body right and left
transform.Rotate(
0,
@honix
honix / time.red
Last active August 23, 2017 21:04
Red []
time: func [
do-block
/repeat
n
/local
acc
start
][
@honix
honix / let.red
Last active September 5, 2017 15:24
Red []
let: func [
binds
block
/local
ctx
][
ctx: context append/only append binds copy [result: do] block
select ctx 'result
Red []
b: make image! 310x80
draw b [
fill-pen red
box 10x10 60x60
fill-pen blue
box 70x10 120x60
Drawing app
Work in progress!
Red [
Needs: 'View
]
pen-buffer-settings: [500x500 0.0.0.254]
buffer: make image! [500x500 100.100.100]
pen-buffer: make image! pen-buffer-settings
Red [
Needs: 'View
]
dangle: pi / 255
pi2: pi * 2
angle: 0.0
radius: 200
buffer: make image! 500x500
Red []
time: 0.0
radius: 200
view [
base 500x500 rate 30
draw [line 250x250 100x100]
on-time [
time: time + 0.01
@honix
honix / l99.lisp
Created June 27, 2017 20:41
Ninety-Nine Lisp Problems
;; http://www.ic.unicamp.br/~meidanis/courses/mc336/2006s2/funcional/L-99_Ninety-Nine_Lisp_Problems.html
;;
;; trying to use only these sacred symbols
;; (quote, atom, eq, car, cdr, cons and cond)
(defvar s '(a b c d))
(defun my-last (l)
(if (cdr l)