Skip to content

Instantly share code, notes, and snippets.

View ske2004's full-sized avatar
💠
hello

ske ske2004

💠
hello
View GitHub Profile
package io.github.ishidex2.fletching_table.mixin;
import com.mojang.blaze3d.systems.RenderSystem;
import io.github.ishidex2.fletching_table.RenderStuff;
import net.minecraft.block.BlockState;
import net.minecraft.block.FletchingTableBlock;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.Identifier;
@ske2004
ske2004 / kmain.c
Created February 16, 2020 15:03
My os
#define VGA_SCR_WIDTH 80
#define VGA_SCR_HEIGHT 25
short* VGA_PTR = (short*)0xb8000;
void printvmem(const char* str, char color, short offset)
{
int i = 0;
while(str[i] != 0)
{
#include <stdio.h>
static void sayhi(char *text)
{
printf("hi, %s", text);
}
struct {
void (*sayhi)(char*);
} __MODULE_ANOTHER_MODULE_C = {&sayhi};
@ske2004
ske2004 / ids.json
Last active January 20, 2020 14:14
Minecraft numeric id map
{"air":{"id":0,"var":"NIL"},"stone":{"id":1,"var":6},"grass":{"id":2,"var":"NIL"},"dirt":{"id":3,"var":2},"cobblestone":{"id":4,"var":"NIL"},"planks":{"id":5,"var":5},"sapling":{"id":6,"var":5},"bedrock":{"id":7,"var":"NIL"},"flowing_water":{"id":8,"var":"NIL"},"water":{"id":9,"var":"NIL"},"flowing_lava":{"id":10,"var":"NIL"},"lava":{"id":11,"var":"NIL"},"sand":{"id":12,"var":1},"gravel":{"id":13,"var":"NIL"},"gold_ore":{"id":14,"var":"NIL"},"iron_ore":{"id":15,"var":"NIL"},"coal_ore":{"id":16,"var":"NIL"},"log":{"id":17,"var":3},"leaves":{"id":18,"var":3},"sponge":{"id":19,"var":1},"glass":{"id":20,"var":"NIL"},"lapis_ore":{"id":21,"var":"NIL"},"lapis_block":{"id":22,"var":"NIL"},"dispenser":{"id":23,"var":"NIL"},"sandstone":{"id":24,"var":2},"noteblock":{"id":25,"var":"NIL"},"bed":{"id":355,"var":"NIL"},"golden_rail":{"id":27,"var":"NIL"},"detector_rail":{"id":28,"var":"NIL"},"sticky_piston":{"id":29,"var":"NIL"},"web":{"id":30,"var":"NIL"},"tallgrass":{"id":31,"var":2},"deadbush":{"id":32,"var":"NIL"},"pis
@ske2004
ske2004 / main.c
Created January 5, 2020 20:12
HTTP server in C
#include "server.c"
char *body = "<a>href='#'>Test</a>";
char *res = strcat(strcat("HTTP/1.1 200 OK\nDate: Mon, 27 Jul 2019 12:28:53 GMT\nServer: Apache/2.2.14 (Win32)\nLast-Modified: Wed, 22 Jul 2009 19:15:56 GMT\nContent-Length: ", str(strlen(body))), "\nContent-Type: text/html\nConnection: Closed\nContent-Type: text/html; charset=utf-8\n\n");
int handle_conn(int sock)
{
write(sock, res, strlen(res));
}
@ske2004
ske2004 / main.cpp
Created April 22, 2019 21:10
Sudoku solver
int field[9][9];
bool checkInRow(int number, int row)
{
for (int i = 0; i < 9; i++)
{
if (field[row][i] == number)
return true;
}
// Example program
#include <iostream>
#include <string>
template <class T>
class Array
{
private:
T *arr0 = new T();
T *arr1 = new T();
// Example program
#include <iostream>
#include <string>
template <class T>
class Array
{
private:
T *arr0 = new T();
T *arr1 = new T();
@ske2004
ske2004 / AjaxUtils.ts
Created March 2, 2019 12:55
Lightweight AJAX and URL library
/*
Author: ishidex2
License: MIT
*/
class URLUtils
{
static isObj(a):boolean
{
if ((!!a) && (a.constructor === Object))
{
@ske2004
ske2004 / main.cpp
Created October 20, 2018 21:36
Bresenham's line algorithm
// Example program
#include <iostream>
#include <string>
#include <cmath>
char buf[32][32];
void clearBuf()
{
for (int i = 0; i < 32; i++)