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 TOKEN_H | |
| #define TOKEN_H | |
| enum TOKEN_TYPE | |
| { | |
| //ASCII characters reserved | |
| TK_IDENT = 256, | |
| TK_INTEGER, | |
| TK_STRING, | |
| TK_NUMBER, |
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 <stdio.h> | |
| #include <stdlib.h> | |
| #include "token.h" | |
| #define HEAP_STRING_IMPL | |
| #include "rhd/heap_string.h" | |
| #define LINKED_LIST_IMPL | |
| #include "rhd/linked_list.h" |
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 <stdio.h> | |
| #include <stdlib.h> | |
| #include "token.h" | |
| #include "rhd/heap_string.h" | |
| #include "rhd/linked_list.h" | |
| struct lexer | |
| { | |
| char *buf; |
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 <stdio.h> | |
| #include <stdint.h> | |
| #include <string.h> | |
| #include <assert.h> | |
| #include <linux/elf.h> | |
| #define HEAP_STRING_IMPL | |
| #include "heap_string.h" | |
| //https://en.wikipedia.org/wiki/Executable_and_Linkable_Format | |
| //http://www.muppetlabs.com/~breadbox/software/tiny/teensy.html |
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 <stdio.h> | |
| #include <string.h> | |
| int dec(int c) | |
| { | |
| if(c >= '0' && c <= '9') | |
| return c - '0'; | |
| if(c >= 'a' && c <= 'f') | |
| return c - 'a' + 10; | |
| return 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
| #include <stdio.h> | |
| #include <math.h> | |
| #include <vector> | |
| #include <stdint.h> | |
| #include <time.h> | |
| typedef uint8_t u8; | |
| struct vec3 | |
| { |
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
| #!/bin/bash | |
| # usage: ./watermark.sh "your text" input_image_path.png | |
| convert -background none -fill "rgba(128,128,128,0.25)" -font Arial -rotate -30 -pointsize 14 label:"$1" /tmp/wm.png | |
| convert $2 -alpha on \( +clone -tile /tmp/wm.png -draw "color 0,0 reset" \) -composite result.png | |
| #rm /tmp/wm.png |
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 <stdio.h> | |
| #include <Windows.h> | |
| int main(int argc, char** argv) | |
| { | |
| if (argc < 2) | |
| return 0; | |
| HMODULE lib = LoadLibraryA("steam_api.dll"); | |
| bool (*__cdecl SteamAPI_Init)() = (bool(__cdecl*)())GetProcAddress(lib, "SteamAPI_Init"); |
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
| <canvas> | |
| </canvas> | |
| <script> | |
| (function() | |
| { | |
| var canvas = document.getElementsByTagName("canvas")[0]; | |
| var ctx = canvas.getContext("2d"); | |
| canvas.width = window.innerWidth; | |
| canvas.height = window.innerHeight; |
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
| dot(a,b) | |
| { | |
| return (a.x*b.x+a.y*b.y+a.z*b.z); | |
| } | |
| _sqrt(a) | |
| { | |
| prev = 0; | |
| for(i=0.0;i<10000;i = i + 0.1) | |
| { |