This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef LAZY_DELETE_H | |
#define LAZY_DELETE_H | |
template <class Delete> | |
void deleteAll(Delete del) | |
{ | |
delete del; | |
} | |
template <class Delete, class... Deletes> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Declaration | |
____________ | |
// variable | |
a: int; // <var-id>: <type-id>; | |
b: int = 15; // <var-id>: <type-id> = <expr>; | |
// constant variable (must be initialized first) | |
let ca: int = 15; // let <var-id>: <type-id> = <expr>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <vector> | |
enum TokenType | |
{ | |
TK_PLUS, // the token can be addition operator or negation operator | |
TK_MIN, // the token can be subtraction operator or negation operator | |
TK_ASTERISK, // the token can be multiplication operator or pointer dereferece | |
TK_SLASH, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float rand(vec2 c) | |
{ | |
return fract(sin(dot(c.xy ,vec2(12.9898,78.233))) * 43758.5453); | |
} | |
void mainImage( out vec4 fragColor, in vec2 fragCoord ) | |
{ | |
vec2 uv = fragCoord/iResolution.xy; | |
float t = floor(iTime * 60.0) / 60.0; | |
fragColor = vec4(rand(sin(uv) + t)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// License under: WTFPL 1.0 | |
// WARNING: I haven't checked the approximation error yet. | |
#ifndef __FASTMATH_H__ | |
#define __FASTMATH_H__ | |
#define _USE_MATH_DEFINES | |
#include <math.h> | |
inline double fast_fmod(double x, double y) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
double fast_sin(double x) | |
{ | |
return x * | |
(x * x * (x * x * | |
(x * x * (x * x * | |
(x * x * (x * x * | |
1.6059043837e-10 - 2.5052108385e-8) | |
+ 0.0000027557319224) - 0.000198412698413) | |
+ 0.00833333333333) - 0.166666666667) + (double)1.0); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float rand(vec2 p) | |
{ | |
float t = floor(iTime * 10.); | |
return fract(sin(dot(p, vec2(t * 12.9898, t * 78.233))) * 43758.5453); | |
} | |
float noise(vec2 uv, float blockiness) | |
{ | |
vec2 lv = fract(uv); | |
vec2 id = floor(uv); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; I don't know why i made this | |
; nasm -f elf *.asm; ld -dynamic-linker /lib/ld-linux.so.2 -m elf_i386 -s -o fuckyou -lc *.o | |
extern printf | |
extern exit | |
section .data | |
str1 times 23 db 0 | |
section .text | |
global _start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float rand(vec2 p) | |
{ | |
return fract(sin(dot(p, vec2(34.8313, 90.1394))) * 9813.91); | |
} | |
float noise(vec2 p) | |
{ | |
vec2 f = fract(p); | |
vec2 i = floor(p); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Water displacement (MIT License) | |
// Native-M | |
float rand(vec2 p) | |
{ | |
return fract(sin(dot(p, vec2(93.9898, 60.1414))) * 43758.5453); | |
} | |
float noise(vec2 uv, float blockiness) | |
{ |